]> git.baikalelectronics.ru Git - kernel.git/commit
intel_th: msu: Fix possible memory leak in mode_store()
authorWei Yongjun <weiyongjun1@huawei.com>
Mon, 28 Oct 2019 07:06:49 +0000 (09:06 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 4 Nov 2019 14:01:24 +0000 (15:01 +0100)
commit69684da1698e2c561c50291e28736ef6b3b292e4
treeefc4f9eda54c0d063e4fedd6e0a07225334f2554
parent3ce03fa6a76eaefc4266559433eb93b1193d89f0
intel_th: msu: Fix possible memory leak in mode_store()

'mode' is malloced in mode_store() and should be freed before leaving
from the error handling cases, otherwise it will cause memory leak.

Fixes: a420990fdd0d ("intel_th: msu: Introduce buffer interface")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/lkml/20190801013825.182543-1-weiyongjun1@huawei.com/
Link: https://lore.kernel.org/r/20191028070651.9770-6-alexander.shishkin@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwtracing/intel_th/msu.c