]> git.baikalelectronics.ru Git - kernel.git/commit
bnx2x: clamp num_queues to prevent passing a negative value
authorMichal Schmidt <mschmidt@redhat.com>
Tue, 25 Feb 2014 15:04:24 +0000 (16:04 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 26 Feb 2014 20:27:50 +0000 (15:27 -0500)
commitb0e77fea703c6ac21d13095fbc2ce60624e5bf20
tree0b407352012532ea4382f7919298b7fb3a866f64
parentbde2e04b06227a9cc9c6b53e1f56b5acdc23d7d6
bnx2x: clamp num_queues to prevent passing a negative value

Use the clamp() macro to make the calculation of the number of queues
slightly easier to understand. It also avoids a crash when someone
accidentally passes a negative value in num_queues= module parameter.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c