RE: [PATCH RESEND] Input: tegra-kbc - correct call toinput_free_device
From: Stephen Warren
Date: Thu Aug 11 2011 - 12:43:03 EST
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@xxxxxxxxx>
Reviewed-by: Stephen Warren <swarren@xxxxxxxxxx>
> ---
> 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
N§²æìr¸yúèØb²X¬¶ÇvØ^)Þ{.nÇ+·¥{±êçzX§¶¡Ü}©²ÆzÚ&j:+v¨¾«êçzZ+Ê+zf£¢·h§~Ûiÿûàz¹®w¥¢¸?¨èÚ&¢)ßfù^jÇy§m
á@A«a¶Úÿ0¶ìh®åi