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] [day] [month] [year] [list]
Date: Fri, 28 Jun 2024 11:15:28 -0600
From: Shuah Khan <skhan@...uxfoundation.org>
To: Xiaobo Liu <cppcoffee@...il.com>, valentina.manea.m@...il.com,
 shuah@...nel.org, i@...ithal.me
Cc: gregkh@...uxfoundation.org, linux-usb@...r.kernel.org,
 linux-kernel@...r.kernel.org, Shuah Khan <skhan@...uxfoundation.org>
Subject: Re: [PATCH] usb: usbip: remove unnecessary cmd variable

On 6/28/24 04:46, Xiaobo Liu wrote:
> There are two redundant if conditions that can be simplified to directly use pdu->u.cmd_submit.
> 

I see you sent the same patch twice without indicating that it is a
resend with a change in subject line.

How did you determine this change is necessary?

> Signed-off-by: Xiaobo Liu <cppcoffee@...il.com>
> ---
>   drivers/usb/usbip/usbip_common.c | 10 +---------
>   1 file changed, 1 insertion(+), 9 deletions(-)
> 
> diff --git a/drivers/usb/usbip/usbip_common.c b/drivers/usb/usbip/usbip_common.c
> index a2b2da125..74a01a265 100644
> --- a/drivers/usb/usbip/usbip_common.c
> +++ b/drivers/usb/usbip/usbip_common.c
> @@ -568,17 +568,9 @@ static void correct_endian_ret_unlink(struct usbip_header_ret_unlink *pdu,
>   
>   void usbip_header_correct_endian(struct usbip_header *pdu, int send)
>   {
> -	__u32 cmd = 0;
> -
> -	if (send)
> -		cmd = pdu->base.command;
> -
>   	correct_endian_basic(&pdu->base, send);

Did you check what correct_endian_basic() does and why
it is important to check "send" and assign "cmd"

>   
> -	if (!send)
> -		cmd = pdu->base.command;

It is necessary to assign the command after calling
> -
> -	switch (cmd) {
> +	switch (pdu->base.command) {
>   	case USBIP_CMD_SUBMIT:
>   		correct_endian_cmd_submit(&pdu->u.cmd_submit, send);
>   		break;

This patch will introduce an error. NAK on this patch.

thanks,
-- Shuah

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ