diff mbox series

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

Message ID 20190125160542.6939-1-shuah@kernel.org (mailing list archive)
State Mainlined
Commit a2fd23b93733bf604870eb8a15ccaa74c9b23889
Headers show
Series usbip: Fix vep_free_request() null pointer checks on input args | expand

Commit Message

Shuah Jan. 25, 2019, 4:05 p.m. UTC
Fix vep_free_request() to return when usb_ep and usb_request are null
instead of calling WARN_ON.

Signed-off-by: Shuah Khan <shuah@kernel.org>
---
 drivers/usb/usbip/vudc_dev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/usb/usbip/vudc_dev.c b/drivers/usb/usbip/vudc_dev.c
index 1634d8698e15..a72c17ff1c6a 100644
--- a/drivers/usb/usbip/vudc_dev.c
+++ b/drivers/usb/usbip/vudc_dev.c
@@ -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);