Skip to content

Commit

Permalink
Input: tegra-kbc - correct call to input_free_device
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
  • Loading branch information
Axel Lin authored and Dmitry Torokhov committed Aug 11, 2011
1 parent d9b830f commit 22f8320
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/input/keyboard/tegra-kbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ static int __devinit tegra_kbc_probe(struct platform_device *pdev)
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;
Expand Down

0 comments on commit 22f8320

Please sign in to comment.