Skip to content

Commit

Permalink
[ACPI] check for kmalloc failure in toshiba_acpi.c
Browse files Browse the repository at this point in the history
Signed-off-by: Panagiotis Issaris <takis@gna.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Panagiotis Issaris authored and Len Brown committed Jul 12, 2005
1 parent 83ea744 commit f422415
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/acpi/toshiba_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit f422415

Please sign in to comment.