OSDN Git Service
(root)
/
tomoyo
/
tomoyo-test1.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c526c62
)
usb: gadget: u_ether: fix dereference after null check coverify warning
author
Peter Chen
<peter.chen@nxp.com>
Fri, 1 Jul 2016 07:33:29 +0000
(15:33 +0800)
committer
Felipe Balbi
<felipe.balbi@linux.intel.com>
Thu, 11 Aug 2016 12:09:44 +0000
(15:09 +0300)
dev->port_usb is checked for null pointer at above code, so dev->port_usb
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/function/u_ether.c
patch
|
blob
|
history
diff --git
a/drivers/usb/gadget/function/u_ether.c
b/drivers/usb/gadget/function/u_ether.c
index
a3f7e7c
..
5f562c1
100644
(file)
--- a/
drivers/usb/gadget/function/u_ether.c
+++ b/
drivers/usb/gadget/function/u_ether.c
@@
-556,7
+556,8
@@
static netdev_tx_t eth_start_xmit(struct sk_buff *skb,
/* Multi frame CDC protocols may store the frame for
* later which is not a dropped frame.
*/
- if (dev->port_usb->supports_multi_frame)
+ if (dev->port_usb &&
+ dev->port_usb->supports_multi_frame)
goto multiframe;
goto drop;
}