[lvc-project] [PATCH] usb: gadget: net2280: fix NULL pointer dereference
Valery Zabrovsky
valthebrewer at yandex.ru
Thu Mar 16 18:53:55 MSK 2023
In net2280_free_request():
If _ep is NULL, then ep is NULL and is dereferenced
while trying to produce an error message.
The patch replaces dev_err() with pr_err() which works fine.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: 9ceafcc2b3ad ("usb: gadget: net2280: print error in ep_ops error paths")
Signed-off-by: Valery Zabrovsky <valthebrewer at yandex.ru>
---
drivers/usb/gadget/udc/net2280.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/usb/gadget/udc/net2280.c b/drivers/usb/gadget/udc/net2280.c
index 1b929c519cd7..a027d1323993 100644
--- a/drivers/usb/gadget/udc/net2280.c
+++ b/drivers/usb/gadget/udc/net2280.c
@@ -584,8 +584,7 @@ static void net2280_free_request(struct usb_ep *_ep, struct usb_request *_req)
ep = container_of(_ep, struct net2280_ep, ep);
if (!_ep || !_req) {
- dev_err(&ep->dev->pdev->dev, "%s: Invalid ep=%p or req=%p\n",
- __func__, _ep, _req);
+ pr_err("%s: Invalid ep=%p or req=%p\n", __func__, _ep, _req);
return;
}
--
2.34.1
More information about the lvc-project
mailing list