]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
bnx2x: fix a crash on corrupt firmware file
authorMichal Schmidt <mschmidt@redhat.com>
Thu, 15 Mar 2012 14:08:28 +0000 (14:08 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 16 Mar 2012 08:57:26 +0000 (01:57 -0700)
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>
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c

index 254521319150e5cb74541a3973434497900dc8d5..00ff62f9285815f501e9d8e4939779dc1169be2c 100644 (file)
@@ -10901,6 +10901,7 @@ init_ops_alloc_err:
        kfree(bp->init_data);
 request_firmware_exit:
        release_firmware(bp->firmware);
+       bp->firmware = NULL;
 
        return rc;
 }