Input: sparse-keymap - free the right keymap on error
authorYong Wang <yong.y.wang@linux.intel.com>
Sat, 20 Mar 2010 06:02:16 +0000 (23:02 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Sat, 20 Mar 2010 06:03:09 +0000 (23:03 -0700)
'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>
drivers/input/sparse-keymap.c

index e6bde55e5203c06f651dfaa7e6ef7f1cfc1633a8..f64e004935a9fe456ab7cce0685ed896e760d620 100644 (file)
@@ -163,7 +163,7 @@ int sparse_keymap_setup(struct input_dev *dev,
        return 0;
 
  err_out:
-       kfree(keymap);
+       kfree(map);
        return error;
 
 }