Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f4224153 authored by Panagiotis Issaris's avatar Panagiotis Issaris Committed by Len Brown
Browse files

[ACPI] check for kmalloc failure in toshiba_acpi.c



Signed-off-by: default avatarPanagiotis Issaris <takis@gna.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 83ea7445
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -263,6 +263,9 @@ dispatch_write(struct file* file, const char __user * buffer,
	 * destination so that sscanf can be used on it safely.
	 */
	tmp_buffer = kmalloc(count + 1, GFP_KERNEL);
	if(!tmp_buffer)
		return -ENOMEM;

	if (copy_from_user(tmp_buffer, buffer, count)) {
		result = -EFAULT;
	}