Commit cd9d7213 authored by Sudip Mukherjee's avatar Sudip Mukherjee Committed by Marcel Holtmann

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: default avatarSudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Acked-by: default avatarMichael Hennerich <michael.hennerich@analog.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent feb2add3
...@@ -1030,6 +1030,7 @@ static int adf7242_hw_init(struct adf7242_local *lp) ...@@ -1030,6 +1030,7 @@ static int adf7242_hw_init(struct adf7242_local *lp)
if (ret) { if (ret) {
dev_err(&lp->spi->dev, dev_err(&lp->spi->dev,
"upload firmware failed with %d\n", ret); "upload firmware failed with %d\n", ret);
release_firmware(fw);
return ret; return ret;
} }
...@@ -1037,6 +1038,7 @@ static int adf7242_hw_init(struct adf7242_local *lp) ...@@ -1037,6 +1038,7 @@ static int adf7242_hw_init(struct adf7242_local *lp)
if (ret) { if (ret) {
dev_err(&lp->spi->dev, dev_err(&lp->spi->dev,
"verify firmware failed with %d\n", ret); "verify firmware failed with %d\n", ret);
release_firmware(fw);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment