From: Dave Jones Date: Thu, 6 Mar 2014 17:20:28 +0000 (-0500) Subject: perf/x86: Fix leak in uncore_type_init failure paths X-Git-Tag: v3.14-rc7~2^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7b4839d93e50adccef29eccb694807cdcb8bee3;p=pandora-kernel.git perf/x86: Fix leak in uncore_type_init failure paths The error path of uncore_type_init() frees up any allocations that were made along the way, but it relies upon type->pmus being set, which only happens if the function succeeds. As type->pmus remains null in this case, the call to uncore_type_exit will do nothing. Moving the assignment earlier will allow us to actually free those allocations should something go awry. Signed-off-by: Dave Jones Acked-by: Peter Zijlstra Link: http://lkml.kernel.org/r/20140306172028.GA552@redhat.com Signed-off-by: Ingo Molnar --- Reading git-diff-tree failed