projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
700aa7f
)
usb: gadget: composite: fix dereference after null check coverify warning
author
Peter Chen
<peter.chen@nxp.com>
Fri, 1 Jul 2016 07:33:28 +0000
(15:33 +0800)
committer
Felipe Balbi
<felipe.balbi@linux.intel.com>
Thu, 11 Aug 2016 12:09:44 +0000
(15:09 +0300)
cdev->config is checked for null pointer at above code, so cdev->config
might be null, fix it by adding null pointer check.
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/gadget/composite.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/usb/gadget/composite.c
b/drivers/usb/gadget/composite.c
index eb648485a58c571001c4e31b7c79aadaaee04445..a8ecc7a612b930e47db97917b5a07c6d2e6eff3c 100644
(file)
--- a/
drivers/usb/gadget/composite.c
+++ b/
drivers/usb/gadget/composite.c
@@
-1913,6
+1913,8
@@
unknown:
break;
case USB_RECIP_ENDPOINT:
+ if (!cdev->config)
+ break;
endp = ((w_index & 0x80) >> 3) | (w_index & 0x0f);
list_for_each_entry(f, &cdev->config->functions, list) {
if (test_bit(endp, f->endpoints))