linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* USB: usbip: remove useless call in usbip_recv
@ 2018-01-02 14:02 Gustavo A. R. Silva
  0 siblings, 0 replies; 2+ messages in thread
From: Gustavo A. R. Silva @ 2018-01-02 14:02 UTC (permalink / raw)
  To: Valentina Manea, Shuah Khan, Greg Kroah-Hartman
  Cc: linux-usb, linux-kernel, 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")
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/usb/usbip/usbip_common.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/usb/usbip/usbip_common.c b/drivers/usb/usbip/usbip_common.c
index 7b219d9..b5af6fc 100644
--- a/drivers/usb/usbip/usbip_common.c
+++ b/drivers/usb/usbip/usbip_common.c
@@ -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);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* USB: usbip: remove useless call in usbip_recv
@ 2018-01-02 23:36 Shuah Khan
  0 siblings, 0 replies; 2+ messages in thread
From: Shuah Khan @ 2018-01-02 23:36 UTC (permalink / raw)
  To: Gustavo A. R. Silva, Valentina Manea, Greg Kroah-Hartman
  Cc: linux-usb, linux-kernel, Shuah Khan, Shuah Khan

On 01/02/2018 07:02 AM, Gustavo A. R. Silva wrote:
> 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")
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
> ---
>  drivers/usb/usbip/usbip_common.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/usb/usbip/usbip_common.c b/drivers/usb/usbip/usbip_common.c
> index 7b219d9..b5af6fc 100644
> --- a/drivers/usb/usbip/usbip_common.c
> +++ b/drivers/usb/usbip/usbip_common.c
> @@ -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.

Acked-by: Shuah Khan <shuahkh@osg.samsung.com>

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 majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-01-02 23:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-02 14:02 USB: usbip: remove useless call in usbip_recv Gustavo A. R. Silva
  -- strict thread matches above, loose matches on Subject: below --
2018-01-02 23:36 Shuah Khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).