From: Jesper Juhl Date: Thu, 12 Apr 2012 03:55:18 +0000 (-0700) Subject: Input: da9052 - fix memory leak in da9052_onkey_probe() X-Git-Tag: v3.4-rc3~36^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e3d0f3d960bf5b895adcf9ffc79d2077f1411d5;p=pandora-kernel.git Input: da9052 - fix memory leak in da9052_onkey_probe() If, in drivers/input/misc/da9052_onkey.c::da9052_onkey_probe(), the call to either kzalloc() or input_allocate_device() fails then we will return -ENOMEM from the function without freeing the other allocation that may have succeeded, thus we leak either the memory allocated for 'onkey' or the memory allocated for 'input_dev' if one succeeds and the other fails. Fix that by jumping to the 'err_free_mem' label at the end of the function that properly cleans up rather than returning directly. Signed-off-by: Jesper Juhl Signed-off-by: Dmitry Torokhov --- Reading git-diff-tree failed