projects
/
GitHub
/
mt8127
/
android_kernel_alcatel_ttab.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
94f5659
)
staging: otus: check kmalloc() return value
author
Kulikov Vasiliy
<segooon@gmail.com>
Fri, 30 Jul 2010 11:08:00 +0000
(15:08 +0400)
committer
Greg Kroah-Hartman
<gregkh@suse.de>
Tue, 3 Aug 2010 01:23:44 +0000
(18:23 -0700)
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>
drivers/staging/otus/wrap_usb.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/staging/otus/wrap_usb.c
b/drivers/staging/otus/wrap_usb.c
index 93459cadc472f75dee6c3ff52f4409ba992e6d8e..9f04047bf5a6b18296b19bbc8f9019beb4661fe1 100644
(file)
--- 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;