]> git.baikalelectronics.ru Git - kernel.git/commit
bnxt_en: Fix comparison of u16 sw_id against negative value.
authorMichael Chan <mchan@broadcom.com>
Thu, 5 Nov 2015 21:25:50 +0000 (16:25 -0500)
committerDavid S. Miller <davem@davemloft.net>
Thu, 5 Nov 2015 21:33:09 +0000 (16:33 -0500)
commit03e3528ab45702d84dd7dc4292570f1610559f77
treef85af33556534f38c9d6d202edc0560033ea04fc
parent3daa7fa3f1a939b8920105aeb0a32774b5b9f142
bnxt_en: Fix comparison of u16 sw_id against negative value.

Assign the return value from bitmap_find_free_region() to an integer
variable and check for negative error codes first, before assigning
the bit ID to the unsigned sw_id field.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt.c