Skip to contentSkip to conversation

USB: usbip: remove useless call in usbip_recv

PATCH In review Gustavo A. R. Silva 2 participants 2 messages Jan 2, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 USB: usbip: remove useless call in usbip_recv

Calling msg_data_left(&msg) is only useful for its return value, which in this particular case is ignored.

Fix this by removing such call.

Addresses-Coverity-ID: 1427080

Fixes 90120d15f4c3 ("usbip: prevent leaking socket pointer address in messages")
---
 drivers/usb/usbip/usbip_common.c | 1 -
 1 file changed, 1 deletion(-)
drivers/usb/usbip/usbip_common.c +0 -1
index 7b219d9..b5af6fc 100644
@@ -325,7 +325,6 @@ int usbip_recv(struct socket *sock, void *buf, int size)
 	usbip_dbg_xmit("enter\n");
 
 	do {
-		msg_data_left(&msg);
 		sock->sk->sk_allocation = GFP_NOIO;
 
 		result = sock_recvmsg(sock, &msg, MSG_WAITALL);
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 18 lines · Gustavo A. R. Silva

Calling msg_data_left(&msg) is only useful for its return value, which in this particular case is ignored.

Fix this by removing such call.

Addresses-Coverity-ID: 1427080

Fixes 90120d15f4c3 ("usbip: prevent leaking socket pointer address in messages")
---
 drivers/usb/usbip/usbip_common.c | 1 -
 1 file changed, 1 deletion(-)
drivers/usb/usbip/usbip_common.c +0 -0
index 7b219d9..b5af6fc 100644

drivers/usb/usbip/usbip_common.c int usbip_recv(struct socket *sock, void *buf, int size) · line 330

Quoted 7 lines
drivers/usb/usbip/usbip_common.c +0 -1
@@ -325,7 +325,6 @@ int usbip_recv(struct socket *sock, void *buf, int size)
 	usbip_dbg_xmit("enter\n");
 
 	do {
-		msg_data_left(&msg);
 		sock->sk->sk_allocation = GFP_NOIO;
 
 		result = sock_recvmsg(sock, &msg, MSG_WAITALL);

Thanks for the patch. Looks good to me.

Greg, please pick this patch up.

thanks,
-- Shuah
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html