netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 1/2] bnx2x: fix a crash on corrupt firmware file
@ 2012-03-16  0:08 Michal Schmidt
  2012-03-16  0:08 ` [PATCH net 2/2] bnx2x: fix memory leak in bnx2x_init_firmware() Michal Schmidt
  2012-03-16  7:24 ` [PATCH net 1/2] bnx2x: fix a crash on corrupt firmware file Eilon Greenstein
  0 siblings, 2 replies; 6+ messages in thread
From: Michal Schmidt @ 2012-03-16  0:08 UTC (permalink / raw)
  To: netdev; +Cc: Yuval Mintz, Yaniv Rosner, Eilon Greenstein, Dmitry Kravkov

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>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 2545213..00ff62f 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -10901,6 +10901,7 @@ init_ops_alloc_err:
 	kfree(bp->init_data);
 request_firmware_exit:
 	release_firmware(bp->firmware);
+	bp->firmware = NULL;
 
 	return rc;
 }
-- 
1.7.7.6

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-03-16  8:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-16  0:08 [PATCH net 1/2] bnx2x: fix a crash on corrupt firmware file Michal Schmidt
2012-03-16  0:08 ` [PATCH net 2/2] bnx2x: fix memory leak in bnx2x_init_firmware() Michal Schmidt
2012-03-16  7:24   ` Eilon Greenstein
2012-03-16  8:57     ` David Miller
2012-03-16  7:24 ` [PATCH net 1/2] bnx2x: fix a crash on corrupt firmware file Eilon Greenstein
2012-03-16  8:57   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).