]> git.baikalelectronics.ru Git - kernel.git/commit
intel_th: msu-sink: Potential dereference of null pointer
authorJiasheng Jiang <jiasheng@iscas.ac.cn>
Tue, 5 Jul 2022 08:26:33 +0000 (11:26 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:23:49 +0000 (14:23 +0200)
commit11dc3bd8646e56c6f244a2b28340d09a2abd9b5e
tree9e9428d4f5d5f1b06fa0e08c7a2793b0c719c810
parent4b81cb94a8f84bfc0c7ecc26525b440cab05e888
intel_th: msu-sink: Potential dereference of null pointer

[ Upstream commit 4f30d95db3de62262dbd6f1e4d6f7d12a14aa1ee ]

The return value of dma_alloc_coherent() needs to be checked.
To avoid use of null pointer in sg_set_buf() in case of the failure of
alloc.

Fixes: c5e79f497312 ("intel_th: msu-sink: An example msu buffer "sink"")
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Link: https://lore.kernel.org/r/20220705082637.59979-3-alexander.shishkin@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hwtracing/intel_th/msu-sink.c