[061/139] Input: sparse-keymap - free the right keymap on error

From: Greg KH
Date: Thu Apr 22 2010 - 16:21:11 EST


2.6.33-stable review patch. If anyone has any objections, please let us know.

------------------

From: Yong Wang <yong.y.wang@xxxxxxxxxxxxxxx>

commit 88fcf710c13bd41f2b98c5411e4f21ab98da4fb4 upstream.

'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@xxxxxxxxx>
Signed-off-by: Dmitry Torokhov <dtor@xxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

---
drivers/input/sparse-keymap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/input/sparse-keymap.c
+++ b/drivers/input/sparse-keymap.c
@@ -161,7 +161,7 @@ int sparse_keymap_setup(struct input_dev
return 0;

err_out:
- kfree(keymap);
+ kfree(map);
return error;

}


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/