summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDing Xiang <dingxiang@cmss.chinamobile.com>2019-08-21 10:49:52 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-09-06 10:18:17 +0200
commitc25b7d78f0e871b10a38a0da9dbc9c538217bef9 (patch)
treec67bfa9234f0240a3649188f660e1559892256f6
parente2f1509fca476d763d94eb0026b28c22ab110688 (diff)
downloadlinux-stable-c25b7d78f0e871b10a38a0da9dbc9c538217bef9.tar.gz
linux-stable-c25b7d78f0e871b10a38a0da9dbc9c538217bef9.tar.bz2
linux-stable-c25b7d78f0e871b10a38a0da9dbc9c538217bef9.zip
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 <dingxiang@cmss.chinamobile.com> Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> 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 <gregkh@linuxfoundation.org>
-rw-r--r--drivers/hwtracing/stm/core.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm/core.c
index e880702a3784..5eb9c3bba216 100644
--- a/drivers/hwtracing/stm/core.c
+++ b/drivers/hwtracing/stm/core.c
@@ -1020,7 +1020,6 @@ int stm_source_register_device(struct device *parent,
err:
put_device(&src->dev);
- kfree(src);
return err;
}