diff mbox

[media] DVB, USB, lmedm04: Fix firmware mem leak in lme_firmware_switch()

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

Commit Message

Jesper Juhl April 7, 2011, 7:46 p.m. UTC
Don't leak 'fw' in 
drivers/media/dvb/dvb-usb/lmedm04.c::lme_firmware_switch() by failing to 
call release_firmware().

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

 compile tested only

Comments

Malcolm Priestley April 7, 2011, 7:56 p.m. UTC | #1
On Thu, 2011-04-07 at 21:46 +0200, Jesper Juhl wrote:
> Don't leak 'fw' in 
> drivers/media/dvb/dvb-usb/lmedm04.c::lme_firmware_switch() by failing to 
> call release_firmware().
> 
> Signed-off-by: Jesper Juhl <jj@chaosbits.net>
> ---
>  lmedm04.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
>  compile tested only
> 
> diff --git a/drivers/media/dvb/dvb-usb/lmedm04.c b/drivers/media/dvb/dvb-usb/lmedm04.c
> index cd26e7c..d7cc625 100644
> --- a/drivers/media/dvb/dvb-usb/lmedm04.c
> +++ b/drivers/media/dvb/dvb-usb/lmedm04.c
> @@ -799,7 +799,7 @@ static int lme_firmware_switch(struct usb_device *udev, int cold)
>  	if (cold) {
>  		info("FRM Changing to %s firmware", fw_lme);
>  		lme_coldreset(udev);
> -		return -ENODEV;
> +		ret = -ENODEV;
>  	}
>  
>  	release_firmware(fw);

This has already been fixed in this commit

http://git.linuxtv.org/media_tree.git?a=commit;h=b328817a2a391d1e879c4252cd3f11a352d3f3bc


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jesper Juhl April 7, 2011, 7:59 p.m. UTC | #2
On Thu, 7 Apr 2011, Malcolm Priestley wrote:

> On Thu, 2011-04-07 at 21:46 +0200, Jesper Juhl wrote:
> > Don't leak 'fw' in 
> > drivers/media/dvb/dvb-usb/lmedm04.c::lme_firmware_switch() by failing to 
> > call release_firmware().
> > 
> > Signed-off-by: Jesper Juhl <jj@chaosbits.net>
> > ---
> >  lmedm04.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> >  compile tested only
> > 
> > diff --git a/drivers/media/dvb/dvb-usb/lmedm04.c b/drivers/media/dvb/dvb-usb/lmedm04.c
> > index cd26e7c..d7cc625 100644
> > --- a/drivers/media/dvb/dvb-usb/lmedm04.c
> > +++ b/drivers/media/dvb/dvb-usb/lmedm04.c
> > @@ -799,7 +799,7 @@ static int lme_firmware_switch(struct usb_device *udev, int cold)
> >  	if (cold) {
> >  		info("FRM Changing to %s firmware", fw_lme);
> >  		lme_coldreset(udev);
> > -		return -ENODEV;
> > +		ret = -ENODEV;
> >  	}
> >  
> >  	release_firmware(fw);
> 
> This has already been fixed in this commit
> 
> http://git.linuxtv.org/media_tree.git?a=commit;h=b328817a2a391d1e879c4252cd3f11a352d3f3bc
> 
I see. Thanks. I was not aware of that.
diff mbox

Patch

diff --git a/drivers/media/dvb/dvb-usb/lmedm04.c b/drivers/media/dvb/dvb-usb/lmedm04.c
index cd26e7c..d7cc625 100644
--- a/drivers/media/dvb/dvb-usb/lmedm04.c
+++ b/drivers/media/dvb/dvb-usb/lmedm04.c
@@ -799,7 +799,7 @@  static int lme_firmware_switch(struct usb_device *udev, int cold)
 	if (cold) {
 		info("FRM Changing to %s firmware", fw_lme);
 		lme_coldreset(udev);
-		return -ENODEV;
+		ret = -ENODEV;
 	}
 
 	release_firmware(fw);