Skip to contentSkip to conversation

usbip: Fix vep_free_request() null pointer checks on input args

PATCH New Shuah Khan 1 participant 1 message Jan 25, 2019

Subsystems (2)
lore
Share & tools
lore

Shuah Khan

author maintainer
#0 lore raw

PATCH 1/1 usbip: Fix vep_free_request() null pointer checks on input args

Fix vep_free_request() to return when usb_ep and usb_request are null instead of calling WARN_ON.

---
 drivers/usb/usbip/vudc_dev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/usbip/vudc_dev.c +2 -1
index 1634d8698e15..a72c17ff1c6a 100644
@@ -297,7 +297,8 @@ static void vep_free_request(struct usb_ep *_ep, struct usb_request *_req)
 {
 	struct vrequest *req;
 
-	if (WARN_ON(!_ep || !_req))
+	/* ep is always valid here - see usb_ep_free_request() */
+	if (!_req)
 		return;
 
 	req = to_vrequest(_req);