]> www.infradead.org Git - users/dwmw2/linux.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>
Sun, 21 Aug 2022 13:15:57 +0000 (15:15 +0200)
commit81222cfda686f962a1fca8f635c0bdf452dbc57b
treea9623e4c39471f00ca07fc5378c213d2baad4731
parenta8f3b78b1f8e959d06801ae82149f140a75724e8
intel_th: msu-sink: Potential dereference of null pointer

[ Upstream commit 82f76a4a720791d889de775b5f7541d601efc8bd ]

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: f220df66f676 ("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