]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
misc: ibmvmc: Use GFP_ATOMIC under spin lock
authorWei Yongjun <weiyongjun1@huawei.com>
Sat, 26 May 2018 09:45:59 +0000 (09:45 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Oct 2018 23:59:03 +0000 (16:59 -0700)
[ Upstream commit 97b715b62e5b4c6edb75d023f556fd09a46cb4e1 ]

The function alloc_dma_buffer() is called from ibmvmc_add_buffer(),
in which a spin lock be held here, so we should use GFP_ATOMIC when
a lock is held.

Fixes: 0eca353e7ae7 ("misc: IBM Virtual Management Channel Driver (VMC)")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Bryant G. Ly <bryantly@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/ibmvmc.c

index 50d82c3d032ae2ab808fa23e5bc953eb1ae4846e..b8aaa684c397b0b8be8fe0c5ae00a37b087b6997 100644 (file)
@@ -273,7 +273,7 @@ static void *alloc_dma_buffer(struct vio_dev *vdev, size_t size,
                              dma_addr_t *dma_handle)
 {
        /* allocate memory */
-       void *buffer = kzalloc(size, GFP_KERNEL);
+       void *buffer = kzalloc(size, GFP_ATOMIC);
 
        if (!buffer) {
                *dma_handle = 0;