Skip to content

Commit

Permalink
bnx2x: fix a crash on corrupt firmware file
Browse files Browse the repository at this point in the history
If the requested firmware is deemed corrupt and then released, reset the
pointer to NULL in order to avoid double-freeing it in
bnx2x_release_firmware() or dereferencing it in bnx2x_init_firmware().

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Acked-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
michich authored and davem330 committed Mar 16, 2012
1 parent cc34eb6 commit 127d0a1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -10901,6 +10901,7 @@ int bnx2x_init_firmware(struct bnx2x *bp)
kfree(bp->init_data);
request_firmware_exit:
release_firmware(bp->firmware);
bp->firmware = NULL;

return rc;
}
Expand Down

0 comments on commit 127d0a1

Please sign in to comment.