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:   Thu, 12 Jul 2018 14:27:13 -0500
From:   "Gustavo A. R. Silva" <gustavo@...eddedor.com>
To:     David Miller <davem@...emloft.net>
Cc:     linux-usb@...r.kernel.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: usb: hso: use swap macro in hso_kick_transmit

Hi David,

On 07/12/2018 12:58 AM, David Miller wrote:
> From: "Gustavo A. R. Silva" <gustavo@...eddedor.com>
> Date: Mon, 9 Jul 2018 10:40:48 -0500
> 
>> @@ -1748,14 +1747,11 @@ static void hso_kick_transmit(struct hso_serial *serial)
>>  		goto out;
>>  
>>  	/* Switch pointers around to avoid memcpy */
>> -	temp = serial->tx_buffer;
>> -	serial->tx_buffer = serial->tx_data;
>> -	serial->tx_data = temp;
>> +	swap(serial->tx_buffer, serial->tx_data);
>>  	serial->tx_data_count = serial->tx_buffer_count;
>>  	serial->tx_buffer_count = 0;
>>  
>> -	/* If temp is set, it means we switched buffers */
>> -	if (temp && serial->write_data) {
>> +	if (serial->write_data) {
> 
> I think temp can be NULL here, you have to retain this check.
> 

I see. Well, in that case I will check serial->tx_data instead.

Thanks for the feedback.
--
Gustavo

Powered by blists - more mailing lists