From: Ding Xiang Date: Wed, 21 Aug 2019 07:49:52 +0000 (+0300) Subject: stm class: Fix a double free of stm_source_device X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9a0b3fbf6bfc484c34a8762625388d5d81d0d9d4;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git stm class: Fix a double free of stm_source_device commit 961b6ffe0e2c403b09a8efe4a2e986b3c415391a upstream. In the error path of stm_source_register_device(), the kfree is unnecessary, as the put_device() before it ends up calling stm_source_device_release() to free stm_source_device, leading to a double free at the outer kfree() call. Remove it. Signed-off-by: Ding Xiang Signed-off-by: Alexander Shishkin Fixes: 7bd1d4093c2fa ("stm class: Introduce an abstraction for System Trace Module devices") Link: https://lore.kernel.org/linux-arm-kernel/1563354988-23826-1-git-send-email-dingxiang@cmss.chinamobile.com/ Cc: stable@vger.kernel.org # v4.4+ Link: https://lore.kernel.org/r/20190821074955.3925-2-alexander.shishkin@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm/core.c index f4530b08b1e5..c592cef4e82c 100644 --- a/drivers/hwtracing/stm/core.c +++ b/drivers/hwtracing/stm/core.c @@ -1107,7 +1107,6 @@ int stm_source_register_device(struct device *parent, err: put_device(&src->dev); - kfree(src); return err; }