lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 19 Jan 2021 09:42:47 +0530
From:   Viresh Kumar <viresh.kumar@...aro.org>
To:     Johan Hovold <johan@...nel.org>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        greybus-dev@...ts.linaro.org, linux-kernel@...r.kernel.org,
        Alex Elder <elder@...aro.org>
Subject: Re: [greybus-dev] [PATCH] greybus: es2: drop short control-transfer
 checks

On 18-01-21, 15:46, Johan Hovold wrote:
> There's no need to check for short USB control transfers when sending
> data using so remove the redundant sanity checks.
> 
> Signed-off-by: Johan Hovold <johan@...nel.org>
> ---
>  drivers/greybus/es2.c | 9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/greybus/es2.c b/drivers/greybus/es2.c
> index 1df6ab5d339d..48ad154df3a7 100644
> --- a/drivers/greybus/es2.c
> +++ b/drivers/greybus/es2.c
> @@ -567,12 +567,9 @@ static int cport_enable(struct gb_host_device *hd, u16 cport_id,
>  			      USB_DIR_OUT | USB_TYPE_VENDOR |
>  			      USB_RECIP_INTERFACE, cport_id, 0,
>  			      req, sizeof(*req), ES2_USB_CTRL_TIMEOUT);
> -	if (ret != sizeof(*req)) {
> +	if (ret < 0) {
>  		dev_err(&udev->dev, "failed to set cport flags for port %d\n",
>  			cport_id);
> -		if (ret >= 0)
> -			ret = -EIO;
> -
>  		goto out;
>  	}
>  
> @@ -961,12 +958,10 @@ static int arpc_send(struct es2_ap_dev *es2, struct arpc *rpc, int timeout)
>  				 0, 0,
>  				 rpc->req, le16_to_cpu(rpc->req->size),
>  				 ES2_USB_CTRL_TIMEOUT);
> -	if (retval != le16_to_cpu(rpc->req->size)) {
> +	if (retval < 0) {
>  		dev_err(&udev->dev,
>  			"failed to send ARPC request %d: %d\n",
>  			rpc->req->type, retval);
> -		if (retval > 0)
> -			retval = -EIO;
>  		return retval;
>  	}

Reviewed-by: Viresh Kumar <viresh.kumar@...aro.org>

-- 
viresh

Powered by blists - more mailing lists