mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
bonding: fix packets_per_slave showing
There's an issue when showing the value of packets_per_slave due to using signed integer. The value may be < 0 and thus not put through reciprocal_value() before showing. This patch makes it use unsigned integer when showing it. CC: Andy Gospodarek <[email protected]> CC: Jay Vosburgh <[email protected]> CC: Veaceslav Falico <[email protected]> CC: David S. Miller <[email protected]> Signed-off-by: Nikolay Aleksandrov <[email protected]> Acked-by: Veaceslav Falico <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
b05004adf9
commit
a752a8b94d
1 changed files with 2 additions and 2 deletions
|
|
@ -1635,12 +1635,12 @@ static ssize_t bonding_show_packets_per_slave(struct device *d,
|
|||
char *buf)
|
||||
{
|
||||
struct bonding *bond = to_bond(d);
|
||||
int packets_per_slave = bond->params.packets_per_slave;
|
||||
unsigned int packets_per_slave = bond->params.packets_per_slave;
|
||||
|
||||
if (packets_per_slave > 1)
|
||||
packets_per_slave = reciprocal_value(packets_per_slave);
|
||||
|
||||
return sprintf(buf, "%d\n", packets_per_slave);
|
||||
return sprintf(buf, "%u\n", packets_per_slave);
|
||||
}
|
||||
|
||||
static ssize_t bonding_store_packets_per_slave(struct device *d,
|
||||
|
|
|
|||
Loading…
Reference in a new issue