public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix memory leak media IR keytable
@ 2010-02-04  2:01 Yoichi Yuasa
  2010-02-04 12:34 ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 2+ messages in thread
From: Yoichi Yuasa @ 2010-02-04  2:01 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: yuasa, linux-media

Signed-off-by: Yoichi Yuasa <yuasa@linux-mips.org>
---
 drivers/media/IR/ir-keytable.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/media/IR/ir-keytable.c b/drivers/media/IR/ir-keytable.c
index b521ed9..44501d9 100644
--- a/drivers/media/IR/ir-keytable.c
+++ b/drivers/media/IR/ir-keytable.c
@@ -422,8 +422,10 @@ int ir_input_register(struct input_dev *input_dev,
 	ir_dev->rc_tab.size = ir_roundup_tablesize(rc_tab->size);
 	ir_dev->rc_tab.scan = kzalloc(ir_dev->rc_tab.size *
 				    sizeof(struct ir_scancode), GFP_KERNEL);
-	if (!ir_dev->rc_tab.scan)
+	if (!ir_dev->rc_tab.scan) {
+		kfree(ir_dev);
 		return -ENOMEM;
+	}
 
 	IR_dprintk(1, "Allocated space for %d keycode entries (%zd bytes)\n",
 		ir_dev->rc_tab.size,
-- 
1.6.6.1


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

* Re: [PATCH] fix memory leak media IR keytable
  2010-02-04  2:01 [PATCH] fix memory leak media IR keytable Yoichi Yuasa
@ 2010-02-04 12:34 ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 2+ messages in thread
From: Mauro Carvalho Chehab @ 2010-02-04 12:34 UTC (permalink / raw)
  To: Yoichi Yuasa; +Cc: linux-media

Hi Yoichi,

Yoichi Yuasa wrote:
> Signed-off-by: Yoichi Yuasa <yuasa@linux-mips.org>
> ---
>  drivers/media/IR/ir-keytable.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/media/IR/ir-keytable.c b/drivers/media/IR/ir-keytable.c
> index b521ed9..44501d9 100644
> --- a/drivers/media/IR/ir-keytable.c
> +++ b/drivers/media/IR/ir-keytable.c
> @@ -422,8 +422,10 @@ int ir_input_register(struct input_dev *input_dev,
>  	ir_dev->rc_tab.size = ir_roundup_tablesize(rc_tab->size);
>  	ir_dev->rc_tab.scan = kzalloc(ir_dev->rc_tab.size *
>  				    sizeof(struct ir_scancode), GFP_KERNEL);
> -	if (!ir_dev->rc_tab.scan)
> +	if (!ir_dev->rc_tab.scan) {
> +		kfree(ir_dev);
>  		return -ENOMEM;
> +	}


Thanks for the patch, but we've received and applied an identical fix at the development
tree.

-- 

Cheers,
Mauro

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

end of thread, other threads:[~2010-02-04 12:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-04  2:01 [PATCH] fix memory leak media IR keytable Yoichi Yuasa
2010-02-04 12:34 ` Mauro Carvalho Chehab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox