Browse Source

bnx2x: Memory clean up on failure

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Eilon Greenstein 16 years ago
parent
commit
cfb18c5cb7
1 changed files with 3 additions and 0 deletions
  1. 3 0
      drivers/net/bnx2x_init.h

+ 3 - 0
drivers/net/bnx2x_init.h

@@ -274,6 +274,9 @@ static void bnx2x_init_wr_wb(struct bnx2x *bp, u32 addr, const u32 *data,
 		rc = bnx2x_gunzip(bp, (u8 *)data, len);
 		rc = bnx2x_gunzip(bp, (u8 *)data, len);
 		if (rc) {
 		if (rc) {
 			BNX2X_ERR("gunzip failed ! rc %d\n", rc);
 			BNX2X_ERR("gunzip failed ! rc %d\n", rc);
+#ifdef __BIG_ENDIAN
+			kfree(temp);
+#endif
 			return;
 			return;
 		}
 		}
 		len = bp->gunzip_outlen;
 		len = bp->gunzip_outlen;