From: Axel Lin Date: Thu, 11 Aug 2011 16:22:45 +0000 (-0700) Subject: Input: tegra-kbc - correct call to input_free_device X-Git-Tag: v3.2-rc3~11^2~24 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=22f83205e59c97c2460ad8e4bd6e71268cb2f37f;p=platform%2Fupstream%2Fkernel-adaptation-pc.git Input: tegra-kbc - correct call to input_free_device 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 Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c index f270447..a5a7791 100644 --- a/drivers/input/keyboard/tegra-kbc.c +++ b/drivers/input/keyboard/tegra-kbc.c @@ -702,7 +702,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;