diff options
author | Sudip Mukherjee <sudipm.mukherjee@gmail.com> | 2016-04-07 16:46:04 +0530 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2016-04-08 19:33:30 +0200 |
commit | cd9d7213d5f546d9c0795fdcffe4ce5bf63445fd (patch) | |
tree | 5b0130f879cdde39c43c51636804b418a249eeec /drivers/net/ieee802154 | |
parent | feb2add3235ca81dc5cd5d975490c707a24c9889 (diff) | |
download | lwn-cd9d7213d5f546d9c0795fdcffe4ce5bf63445fd.tar.gz lwn-cd9d7213d5f546d9c0795fdcffe4ce5bf63445fd.zip |
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 <sudip.mukherjee@codethink.co.uk>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/net/ieee802154')
-rw-r--r-- | drivers/net/ieee802154/adf7242.c | 2 |
1 files changed, 2 insertions, 0 deletions
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; } |