From: Sudip Mukherjee Date: Thu, 7 Apr 2016 11:16:04 +0000 (+0530) Subject: ieee802154/adf7242: fix memory leak of firmware X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=cd9d7213d5f546d9c0795fdcffe4ce5bf63445fd;p=openwrt%2Fstaging%2Fblogic.git ieee802154/adf7242: fix memory leak of firmware If the firmware upload or the firmware verification fails then we printed the error message and exited but we missed releasing the firmware. Signed-off-by: Sudip Mukherjee Acked-by: Michael Hennerich Signed-off-by: Marcel Holtmann --- diff --git a/drivers/net/ieee802154/adf7242.c b/drivers/net/ieee802154/adf7242.c index 89154c079788..b82e39d24394 100644 --- a/drivers/net/ieee802154/adf7242.c +++ b/drivers/net/ieee802154/adf7242.c @@ -1030,6 +1030,7 @@ static int adf7242_hw_init(struct adf7242_local *lp) if (ret) { dev_err(&lp->spi->dev, "upload firmware failed with %d\n", ret); + release_firmware(fw); return ret; } @@ -1037,6 +1038,7 @@ static int adf7242_hw_init(struct adf7242_local *lp) if (ret) { dev_err(&lp->spi->dev, "verify firmware failed with %d\n", ret); + release_firmware(fw); return ret; }