From: Jiri Slaby Date: Mon, 30 Jun 2014 09:34:48 +0000 (+0200) Subject: HID: sensor-hub: fix potential memory leak X-Git-Tag: cleanup-for-v3.18~287^2~1 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ceec634076b91bea57107541a46e92d765c69488;p=pandora-kernel.git HID: sensor-hub: fix potential memory leak hsdev is not freed in sensor_hub_probe when kasprintf inside the for loop fails. This is because hsdev is not set to platform_data yet (to be freed by the code in the err_no_mem label). So free the memory explicitly in the 'if' branch, as this is the only place where this is (and will) be needed. Reported-by: coverity Signed-off-by: Jiri Slaby Cc: srinivas pandruvada Signed-off-by: Jiri Kosina --- Reading git-diff-tree failed