summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@nxp.com>2016-07-01 09:33:29 +0200
committerFelipe Balbi <felipe.balbi@linux.intel.com>2016-08-11 14:09:44 +0200
commit88c09eacf560c3303d0ee8cf91b8b7ff7f000350 (patch)
tree6d4a5211694e9dca955d25ab390fb26acb543d34 /drivers
parentusb: gadget: composite: fix dereference after null check coverify warning (diff)
downloadlinux-88c09eacf560c3303d0ee8cf91b8b7ff7f000350.tar.xz
linux-88c09eacf560c3303d0ee8cf91b8b7ff7f000350.zip
usb: gadget: u_ether: fix dereference after null check coverify warning
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/gadget/function/u_ether.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/gadget/function/u_ether.c b/drivers/usb/gadget/function/u_ether.c
index a3f7e7c55ebb..5f562c1ec795 100644
--- 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;
}