aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorKulikov Vasiliy <segooon@gmail.com>2010-07-30 15:08:00 +0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-08-02 18:23:44 -0700
commitd49d0e39a09209d0136c7da2a1a52e99af2d4656 (patch)
treeea4a0350a2739c3e05805a8d298321f3d7758a0b /drivers/staging
parent94f5659cfa4f14ba901fbbb8a57d0145754d0d37 (diff)
downloadkernel_samsung_crespo-d49d0e39a09209d0136c7da2a1a52e99af2d4656.zip
kernel_samsung_crespo-d49d0e39a09209d0136c7da2a1a52e99af2d4656.tar.gz
kernel_samsung_crespo-d49d0e39a09209d0136c7da2a1a52e99af2d4656.tar.bz2
staging: otus: check kmalloc() return value
kmalloc() may fail, if so return error from zfwUsbSubmitControl(). Signed-off-by: Kulikov Vasiliy <segooon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/otus/wrap_usb.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/staging/otus/wrap_usb.c b/drivers/staging/otus/wrap_usb.c
index 93459ca..9f04047 100644
--- a/drivers/staging/otus/wrap_usb.c
+++ b/drivers/staging/otus/wrap_usb.c
@@ -104,6 +104,11 @@ u32_t zfwUsbSubmitControl(zdev_t *dev, u8_t req, u16_t value, u16_t index,
if (size > 0) {
buf = kmalloc(size, GFP_KERNEL);
+ if (buf == NULL) {
+ pr_err("zfwUsbSubmitControl() failed, "
+ "kmalloc() returned NULL\n");
+ return 1;
+ }
memcpy(buf, (u8_t *)data, size);
} else
buf = NULL;