Re: [PATCH net-next v2 3/4] s390/qeth: Convert sysfs sprintf to sysfs_emit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 09.02.23 12:27, Simon Horman wrote:
> On Thu, Feb 09, 2023 at 12:04:23PM +0100, Alexandra Winter wrote:
>> From: Thorsten Winkler <twinkler@xxxxxxxxxxxxx>
...
>>  
>> -		entry_len = qeth_l3_ipaddr_to_string(proto, ipatoe->addr,
>> -						     addr_str);
>> -		if (entry_len < 0)
>> -			continue;
> 
> Here the return code of qeth_l3_ipaddr_to_string() is checked for an error.
> 
>> -
>> -		/* Append /%mask to the entry: */
>> -		entry_len += 1 + ((proto == QETH_PROT_IPV4) ? 2 : 3);
>> -		/* Enough room to format %entry\n into null terminated page? */
>> -		if (entry_len + 1 > PAGE_SIZE - str_len - 1)
>> -			break;
>> -
>> -		entry_len = scnprintf(buf, PAGE_SIZE - str_len,
>> -				      "%s/%i\n", addr_str, ipatoe->mask_bits);
>> -		str_len += entry_len;
>> -		buf += entry_len;
>> +		qeth_l3_ipaddr_to_string(proto, ipatoe->addr, addr_str);
> 
> But here it is not. Is that ok?
> 
> Likewise in qeth_l3_dev_ip_add_show().

As you pointed out in your comments to patch 4/4 v1, qeth_l3_ipaddr_to_string()
will never return a negative value, as it only returns the result of s*printf()
which at least in this usecase here will never return < 0.




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux