]> git.baikalelectronics.ru Git - kernel.git/commit
dma-direct: Fix potential NULL pointer dereference
authorThomas Tai <thomas.tai@oracle.com>
Thu, 17 Sep 2020 16:43:03 +0000 (18:43 +0200)
committerChristoph Hellwig <hch@lst.de>
Thu, 17 Sep 2020 16:43:20 +0000 (18:43 +0200)
commit5f2fc58d092835b65c9fec63550430f0783209be
treeb3bb71e9171c97f693240bdeb3e9ad2f0a5d580c
parentf24af532fe6e0ee419864cf47d5b1b2c853cfa55
dma-direct: Fix potential NULL pointer dereference

When booting the kernel v5.9-rc4 on a VM, the kernel would panic when
printing a warning message in swiotlb_map(). The dev->dma_mask must not
be a NULL pointer when calling the dma mapping layer. A NULL pointer
check can potentially avoid the panic.

Signed-off-by: Thomas Tai <thomas.tai@oracle.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
include/linux/dma-direct.h
kernel/dma/mapping.c