OSDN Git Service

spi/topcliff_pch: Fix potential NULL dereference on allocation error
authorYueHaibing <yuehaibing@huawei.com>
Wed, 23 Jan 2019 12:00:22 +0000 (20:00 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jan 2020 13:50:14 +0000 (14:50 +0100)
commit72c50d87f76326e1bd3c1081d09ef25aad243586
tree86a72d0d4c8c46d2408eaaf233afffb1f63d7e71
parent5c2d0191c6c574d84cfa83b1bee73a7e4baccfc6
spi/topcliff_pch: Fix potential NULL dereference on allocation error

[ Upstream commit e902cdcb5112b89ee445588147964723fd69ffb4 ]

In pch_spi_handle_dma, it doesn't check for NULL returns of kcalloc
so it would result in an Oops.

Fixes: c37f3c2749b5 ("spi/topcliff_pch: DMA support")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/spi/spi-topcliff-pch.c