From: Eilon Greenstein Date: Wed, 12 Aug 2009 08:23:48 +0000 (+0000) Subject: bnx2x: Check unzip return code X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=54016b260e873d0d4d30cf1fdbd0cdcf0e26251b;p=openwrt%2Fstaging%2Fblogic.git bnx2x: Check unzip return code Without this check, when running out of memory, we will see PSOD's in bnx2x_init_fill() when doing a memset(). This is because at that time, bp->gunzip_buf is not pointing to a valid allocated space. Signed-off-by: Benjamin Li Signed-off-by: Eilon Greenstein Signed-off-by: David S. Miller --- diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c index 59aacd84d7e1..edd7b137b76c 100644 --- a/drivers/net/bnx2x_main.c +++ b/drivers/net/bnx2x_main.c @@ -6512,7 +6512,9 @@ static int bnx2x_init_hw(struct bnx2x *bp, u32 load_code) bp->dmae_ready = 0; mutex_init(&bp->dmae_mutex); - bnx2x_gunzip_init(bp); + rc = bnx2x_gunzip_init(bp); + if (rc) + return rc; switch (load_code) { case FW_MSG_CODE_DRV_LOAD_COMMON: