[PATCH v1 6/9] usb: at91_udc: remove useless NULL check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



if _ep or ep is NULL, we would get at least in two places
before this test a NULL pointer dereference.

Signed-off-by: Oleksij Rempel <linux@xxxxxxxxxxxxxxxx>
---
 drivers/usb/gadget/at91_udc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index 729f75212..243656d44 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -288,8 +288,7 @@ static int at91_ep_enable(struct usb_ep *_ep,
 	u16		maxpacket;
 	u32		tmp;
 
-	if (!_ep || !ep
-			|| !desc || ep->desc
+	if (!desc || ep->desc
 			|| _ep->name == ep0name
 			|| desc->bDescriptorType != USB_DT_ENDPOINT
 			|| (maxpacket = le16_to_cpu(desc->wMaxPacketSize)) == 0
-- 
2.17.1


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux