patch-2.4.5 linux/drivers/acpi/driver.c

Next file: linux/drivers/atm/eni.c
Previous file: linux/drivers/acorn/block/mfmhd.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.4/linux/drivers/acpi/driver.c linux/drivers/acpi/driver.c
@@ -311,8 +311,10 @@
 		size = buf.length - file->f_pos;
 		if (size > *len)
 			size = *len;
-		if (copy_to_user(buffer, data, size))
+		if (copy_to_user(buffer, data, size)) {
+			kfree(buf.pointer);
 			return -EFAULT;
+		}
 	}
 
 	kfree(buf.pointer);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)