linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND] Input: tegra-kbc - correct call to input_free_device
@ 2011-08-11  8:49 Axel Lin
  2011-08-11 16:42 ` Stephen Warren
  0 siblings, 1 reply; 4+ messages in thread
From: Axel Lin @ 2011-08-11  8:49 UTC (permalink / raw)
  To: linux-kernel; +Cc: Dmitry Torokhov, Rakesh Iyer, linux-input

If kzalloc for kbc fails, then we have NULL pointer dereference while
calling input_free_device(kbc->idev) in the error handling.
So it is safer to always use the original name, input_dev.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/input/keyboard/tegra-kbc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c
index 2b3b73e..8e40f2b 100644
--- a/drivers/input/keyboard/tegra-kbc.c
+++ b/drivers/input/keyboard/tegra-kbc.c
@@ -701,7 +701,7 @@ err_iounmap:
 err_free_mem_region:
 	release_mem_region(res->start, resource_size(res));
 err_free_mem:
-	input_free_device(kbc->idev);
+	input_free_device(input_dev);
 	kfree(kbc);
 
 	return err;
-- 
1.7.4.1




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

* RE: [PATCH RESEND] Input: tegra-kbc - correct call to input_free_device
  2011-08-11  8:49 [PATCH RESEND] Input: tegra-kbc - correct call to input_free_device Axel Lin
@ 2011-08-11 16:42 ` Stephen Warren
  2011-08-11 16:51   ` Dmitry Torokhov
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Warren @ 2011-08-11 16:42 UTC (permalink / raw)
  To: Axel Lin, linux-kernel@vger.kernel.org
  Cc: Dmitry Torokhov, Rakesh Iyer, linux-input@vger.kernel.org

Axel Lin wrote at Thursday, August 11, 2011 2:49 AM:
> If kzalloc for kbc fails, then we have NULL pointer dereference while
> calling input_free_device(kbc->idev) in the error handling.
> So it is safer to always use the original name, input_dev.
> 
> Signed-off-by: Axel Lin <axel.lin@gmail.com>

Reviewed-by: Stephen Warren <swarren@nvidia.com>

> ---
>  drivers/input/keyboard/tegra-kbc.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c
> index 2b3b73e..8e40f2b 100644
> --- a/drivers/input/keyboard/tegra-kbc.c
> +++ b/drivers/input/keyboard/tegra-kbc.c
> @@ -701,7 +701,7 @@ err_iounmap:
>  err_free_mem_region:
>  	release_mem_region(res->start, resource_size(res));
>  err_free_mem:
> -	input_free_device(kbc->idev);
> +	input_free_device(input_dev);
>  	kfree(kbc);
> 
>  	return err;
> --
> 1.7.4.1

-- 
nvpublic


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

* Re: [PATCH RESEND] Input: tegra-kbc - correct call to input_free_device
  2011-08-11 16:42 ` Stephen Warren
@ 2011-08-11 16:51   ` Dmitry Torokhov
  2011-08-11 17:14     ` Stephen Warren
  0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Torokhov @ 2011-08-11 16:51 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Axel Lin, linux-kernel@vger.kernel.org, Rakesh Iyer,
	linux-input@vger.kernel.org

On Thu, Aug 11, 2011 at 09:42:54AM -0700, Stephen Warren wrote:
> Axel Lin wrote at Thursday, August 11, 2011 2:49 AM:
> > If kzalloc for kbc fails, then we have NULL pointer dereference while
> > calling input_free_device(kbc->idev) in the error handling.
> > So it is safer to always use the original name, input_dev.
> > 
> > Signed-off-by: Axel Lin <axel.lin@gmail.com>
> 
> Reviewed-by: Stephen Warren <swarren@nvidia.com>

Gah, sorry, already pushed into my public branch so won't be able so
add your reviewed-by...

-- 
Dmitry

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

* RE: [PATCH RESEND] Input: tegra-kbc - correct call to input_free_device
  2011-08-11 16:51   ` Dmitry Torokhov
@ 2011-08-11 17:14     ` Stephen Warren
  0 siblings, 0 replies; 4+ messages in thread
From: Stephen Warren @ 2011-08-11 17:14 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Axel Lin, linux-kernel@vger.kernel.org, Rakesh Iyer,
	linux-input@vger.kernel.org

Dmitry Torokhov wrote at Thursday, August 11, 2011 10:52 AM:
> On Thu, Aug 11, 2011 at 09:42:54AM -0700, Stephen Warren wrote:
> > Axel Lin wrote at Thursday, August 11, 2011 2:49 AM:
> > > If kzalloc for kbc fails, then we have NULL pointer dereference while
> > > calling input_free_device(kbc->idev) in the error handling.
> > > So it is safer to always use the original name, input_dev.
> > >
> > > Signed-off-by: Axel Lin <axel.lin@gmail.com>
> >
> > Reviewed-by: Stephen Warren <swarren@nvidia.com>
> 
> Gah, sorry, already pushed into my public branch so won't be able so
> add your reviewed-by...

No worries; you had no reason to expect anyone to review it!

-- 
nvpublic

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

end of thread, other threads:[~2011-08-11 17:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-11  8:49 [PATCH RESEND] Input: tegra-kbc - correct call to input_free_device Axel Lin
2011-08-11 16:42 ` Stephen Warren
2011-08-11 16:51   ` Dmitry Torokhov
2011-08-11 17:14     ` Stephen Warren

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).