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)
commit84e86b98f6515aaeaac053b234be158b25457184
treef85af33556534f38c9d6d202edc0560033ea04fc
parent11809490ac17810cff90c12e9f2f3e0303a72121
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