Here it is with the stylistic fixes: Signed-off-by: Brandon Niemczyk --- linux/drivers/acpi/toshiba_acpi.c.orig 2005-07-10 20:40:47.000000000 -0400 +++ linux/drivers/acpi/toshiba_acpi.c 2005-07-10 23:00:43.000000000 -0400 @@ -263,9 +263,11 @@ dispatch_write(struct file* file, const * destination so that sscanf can be used on it safely. */ tmp_buffer = kmalloc(count + 1, GFP_KERNEL); - if (copy_from_user(tmp_buffer, buffer, count)) { + + if (!tmp_buffer) + return -ENOMEM; + else if (copy_from_user(tmp_buffer, buffer, count)) result = -EFAULT; - } else { tmp_buffer[count] = 0; result = item->write_func(tmp_buffer, count); On Sun, 2005-07-10 at 19:32 -0700, randy_dunlap wrote: > On Sun, 10 Jul 2005 21:20:44 -0400 Brandon Niemczyk wrote: > > Looks correct functionally, but needs a space after "if", like "if (". > > Oh, don't use braces for one-line "blocks". > Yes the copy_from_user() below does that too. :( -- Brandon Niemczyk