diff mbox

[media] cx23885: Don't leak firmware in cx23885_card_setup()

Message ID alpine.LNX.2.00.1104072118310.1538@swampdragon.chaosbits.net (mailing list archive)
State Accepted
Headers show

Commit Message

Jesper Juhl April 7, 2011, 7:23 p.m. UTC
We leak the memory allocated to 'fw' (the firmware) when the variable goes 
out of scope.
Fix the leak by calling release_firmware(fw) before 'fw' goes out of 
scope.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
---
 cx23885-cards.c |    1 +
 1 file changed, 1 insertion(+)

  compile tested only.
diff mbox

Patch

diff --git a/drivers/media/video/cx23885/cx23885-cards.c b/drivers/media/video/cx23885/cx23885-cards.c
index ea88722..2354336 100644
--- a/drivers/media/video/cx23885/cx23885-cards.c
+++ b/drivers/media/video/cx23885/cx23885-cards.c
@@ -1399,6 +1399,7 @@  void cx23885_card_setup(struct cx23885_dev *dev)
 		else
 			altera_init(&netup_config, fw);
 
+		release_firmware(fw);
 		break;
 	}
 	}