From: Harish Jenny K N <harish_kandiga@mentor.com>
To: Felipe Balbi <balbi@kernel.org>
Cc: <linux-usb@vger.kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
<linux-kernel@vger.kernel.org>,
Jim Baxter <jim_baxter@mentor.com>, <harish_kandiga@mentor.com>
Subject: [PATCH v1 1/2] usb: gadget: u_ether: fix another dereference after null check
Date: Fri, 9 Sep 2016 11:30:41 +0200 [thread overview]
Message-ID: <1473413442-2377-2-git-send-email-harish_kandiga@mentor.com> (raw)
In-Reply-To: <1473413442-2377-1-git-send-email-harish_kandiga@mentor.com>
dev->port_usb is checked for null pointer previously, so dev->port_usb
might be null during no zlp check, fix it by adding null pointer check.
Acked-by: Jim Baxter <jim_baxter@mentor.com>
Signed-off-by: Harish Jenny K N <harish_kandiga@mentor.com>
---
drivers/usb/gadget/function/u_ether.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/function/u_ether.c b/drivers/usb/gadget/function/u_ether.c
index 3be4b93..9c8c9ed 100644
--- a/drivers/usb/gadget/function/u_ether.c
+++ b/drivers/usb/gadget/function/u_ether.c
@@ -571,7 +571,8 @@ static netdev_tx_t eth_start_xmit(struct sk_buff *skb,
req->complete = tx_complete;
/* NCM requires no zlp if transfer is dwNtbInMaxSize */
- if (dev->port_usb->is_fixed &&
+ if (dev->port_usb &&
+ dev->port_usb->is_fixed &&
length == dev->port_usb->fixed_in_len &&
(length % in->maxpacket) == 0)
req->zero = 0;
--
1.7.9.5
next prev parent reply other threads:[~2016-09-09 9:31 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Harish Jenny K N <harish_kandiga@mentor.com>
2016-09-08 9:18 ` [PATCH v1 0/1] usb: gadget: f_fs: Stop ffs_closed NULL pointers Harish Jenny K N
2016-09-08 9:18 ` [PATCH v1 1/1] " Harish Jenny K N
2016-09-09 9:30 ` [PATCH v1 0/2] usb: gadget: NCM: NULL pointer dereference in eth_start_xmit Harish Jenny K N
2016-09-09 9:30 ` Harish Jenny K N [this message]
2016-09-10 3:39 ` [PATCH v1 1/2] usb: gadget: u_ether: fix another dereference after null check Peter Chen
2016-09-09 9:30 ` [PATCH v1 2/2] usb: gadget: NCM: Protect dev->port_usb using dev->lock Harish Jenny K N
2016-09-15 14:22 ` [PATCH v1 0/3] Usb gadget ncm code cleanup Harish Jenny K N
2016-09-15 14:22 ` [PATCH v1 1/3] usb: gadget: NCM: link socket buffers to the device for tx packets Harish Jenny K N
2016-09-15 14:22 ` [PATCH v1 2/3] usb: gadget: NCM: link socket buffers to the device for received packets Harish Jenny K N
2016-09-15 18:35 ` Yauheni Kaliuta
2016-09-16 9:54 ` Harish Jenny K N
2016-09-15 14:22 ` [PATCH v1 3/3] usb: gadget: NCM: differentiate consumed packets from dropped packets Harish Jenny K N
2016-09-19 8:05 ` [PATCH v2 0/3] Usb gadget ncm code cleanup Harish Jenny K N
2016-09-19 8:05 ` [PATCH v2 1/3] usb: gadget: NCM: link socket buffers to the device for tx packets Harish Jenny K N
2016-09-19 8:05 ` [PATCH v2 2/3] usb: gadget: u_ether: link socket buffers to the device for received packets Harish Jenny K N
2016-09-19 8:05 ` [PATCH v2 3/3] usb: gadget: NCM: differentiate consumed packets from dropped packets Harish Jenny K N
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1473413442-2377-2-git-send-email-harish_kandiga@mentor.com \
--to=harish_kandiga@mentor.com \
--cc=balbi@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=jim_baxter@mentor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®