]> asedeno.scripts.mit.edu Git - linux.git/commit
stm class: Fix a double free of stm_source_device
authorDing Xiang <dingxiang@cmss.chinamobile.com>
Wed, 21 Aug 2019 07:49:52 +0000 (10:49 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Aug 2019 20:29:01 +0000 (22:29 +0200)
commit961b6ffe0e2c403b09a8efe4a2e986b3c415391a
treeb268ce2617009ffda9aa815a175c0cfe5d6023e4
parentc78439f8b97e9719ca3baea4e1a0eef310e4065c
stm class: Fix a double free of stm_source_device

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>
drivers/hwtracing/stm/core.c