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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAA=Fs0mm3=nNkBGbbodSZFcz7hT2NuV6Z_c6a+9qFMr8Vjg+_A@mail.gmail.com>
Date:   Sat, 21 Aug 2021 18:47:28 +0100
From:   Phillip Potter <phil@...lpotter.co.uk>
To:     Martin Kaiser <martin@...ser.cx>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Larry Finger <Larry.Finger@...inger.net>,
        Dan Carpenter <dan.carpenter@...cle.com>,
        Michael Straube <straube.linux@...il.com>,
        linux-staging@...ts.linux.dev,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 10/10] staging: r8188eu: set pipe only once

On Sat, 21 Aug 2021 at 17:50, Martin Kaiser <martin@...ser.cx> wrote:
>
> Set the pipe for reading or writing in usbctrl_vendorreq only once.
> There's no need to set it again for every retry.
>
> This patch is an adaptation of commit 889ed8b5e374 ("staging: rtl8188eu:
> set pipe only once") for the new r8188eu driver.
>
> Signed-off-by: Martin Kaiser <martin@...ser.cx>
> ---
>  drivers/staging/r8188eu/hal/usb_ops_linux.c | 15 ++++++++-------
>  1 file changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/staging/r8188eu/hal/usb_ops_linux.c b/drivers/staging/r8188eu/hal/usb_ops_linux.c
> index 5408383ccec3..5a55ee38d7b8 100644
> --- a/drivers/staging/r8188eu/hal/usb_ops_linux.c
> +++ b/drivers/staging/r8188eu/hal/usb_ops_linux.c
> @@ -40,15 +40,16 @@ static int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u16 value, void *pdata,
>                 goto release_mutex;
>         }
>
> -       while (++vendorreq_times <= MAX_USBCTRL_VENDORREQ_TIMES) {
> -               memset(pIo_buf, 0, len);
> +       if (requesttype == REALTEK_USB_VENQT_READ)
> +               pipe = usb_rcvctrlpipe(udev, 0);/* read_in */
> +       else
> +               pipe = usb_sndctrlpipe(udev, 0);/* write_out */
>
> -               if (requesttype == REALTEK_USB_VENQT_READ) {
> -                       pipe = usb_rcvctrlpipe(udev, 0);/* read_in */
> -               } else {
> -                       pipe = usb_sndctrlpipe(udev, 0);/* write_out */
> +       while (++vendorreq_times <= MAX_USBCTRL_VENDORREQ_TIMES) {
> +               if (requesttype == REALTEK_USB_VENQT_READ)
> +                       memset(pIo_buf, 0, len);
> +               else
>                         memcpy(pIo_buf, pdata, len);
> -               }
>
>                 status = usb_control_msg(udev, pipe, REALTEK_USB_VENQT_CMD_REQ,
>                                          requesttype, value, REALTEK_USB_VENQT_CMD_IDX,
> --
> 2.20.1
>

Acked-by: Phillip Potter <phil@...lpotter.co.uk>

Regards,
Phil

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ