]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
RDMA/vmw_pvrdma: Use atomic memory allocation in create AH
authorGal Pressman <galpress@amazon.com>
Mon, 10 Dec 2018 15:17:25 +0000 (17:17 +0200)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Fri, 17 Jan 2020 17:21:26 +0000 (14:21 -0300)
BugLink: https://bugs.launchpad.net/bugs/1855787
[ Upstream commit a276a4d93bf1580d737f38d1810e5f4b166f3edd ]

Create address handle callback should not sleep, use GFP_ATOMIC instead of
GFP_KERNEL for memory allocation.

Fixes: 29c8d9eba550 ("IB: Add vmw_pvrdma driver")
Cc: Adit Ranadive <aditr@vmware.com>
Signed-off-by: Gal Pressman <galpress@amazon.com>
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c

index a51463cd2f374729cf57a448a26d4be06fc0c342..378a2487667af9b8f01070344a83c2b36222c6ab 100644 (file)
@@ -553,7 +553,7 @@ struct ib_ah *pvrdma_create_ah(struct ib_pd *pd, struct rdma_ah_attr *ah_attr,
        if (!atomic_add_unless(&dev->num_ahs, 1, dev->dsr->caps.max_ah))
                return ERR_PTR(-ENOMEM);
 
-       ah = kzalloc(sizeof(*ah), GFP_KERNEL);
+       ah = kzalloc(sizeof(*ah), GFP_ATOMIC);
        if (!ah) {
                atomic_dec(&dev->num_ahs);
                return ERR_PTR(-ENOMEM);