netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ieee802154/adf7242: fix memory leak of firmware
@ 2016-04-07 11:16 Sudip Mukherjee
  2016-04-07 11:09 ` Michael Hennerich
  2016-04-08 17:34 ` Marcel Holtmann
  0 siblings, 2 replies; 3+ messages in thread
From: Sudip Mukherjee @ 2016-04-07 11:16 UTC (permalink / raw)
  To: Michael Hennerich, Alexander Aring
  Cc: linux-kernel, linux-wpan, netdev, Sudip Mukherjee

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>
---
 drivers/net/ieee802154/adf7242.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ieee802154/adf7242.c b/drivers/net/ieee802154/adf7242.c
index 89154c0..91d4531 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;
 	}
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-04-08 17:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-07 11:16 [PATCH] ieee802154/adf7242: fix memory leak of firmware Sudip Mukherjee
2016-04-07 11:09 ` Michael Hennerich
2016-04-08 17:34 ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).