Input: sparse-keymap - free the right keymap on error
'map' is allocated in sparse_keymap_setup() and it it the one that should
be freed on error instead of 'keymap'.
Signed-off-by: Yong Wang <yong.y.wang@intel.com>
Cc: stable@kernel.org
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
diff --git a/drivers/input/sparse-keymap.c b/drivers/input/sparse-keymap.c
index e6bde55..f64e004 100644
--- a/drivers/input/sparse-keymap.c
+++ b/drivers/input/sparse-keymap.c
@@ -163,7 +163,7 @@
return 0;
err_out:
- kfree(keymap);
+ kfree(map);
return error;
}