public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH][ACPI] toshiba_acpi.c: add check for NULL pointer
@ 2005-08-04  6:08 Hmamouche, Youssef
  2005-08-04  6:39 ` Pekka Enberg
  0 siblings, 1 reply; 2+ messages in thread
From: Hmamouche, Youssef @ 2005-08-04  6:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: toshiba_acpi, youssef


This patch adds a check for NULL return from kmalloc.

Signed-off-by: Youssef Hmamouche <hyoussef@gmail.com>



--- a/drivers/acpi/toshiba_acpi.c       2005-07-15 14:18:57.000000000 -0700
+++ b/drivers/acpi/toshiba_acpi.c       2005-08-03 21:35:12.000000000 -0700
@@ -263,6 +263,9 @@
          * destination so that sscanf can be used on it safely.
          */
         tmp_buffer = kmalloc(count + 1, GFP_KERNEL);
+       if(tmp_buffer == NULL) {
+               return -ENOMEM;
+       }
         if (copy_from_user(tmp_buffer, buffer, count)) {
                 result = -EFAULT;
         }

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-08-04  6:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-04  6:08 [PATCH][ACPI] toshiba_acpi.c: add check for NULL pointer Hmamouche, Youssef
2005-08-04  6:39 ` Pekka Enberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox