diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2021-11-18 14:39:24 +0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2021-11-19 12:02:30 -0400 |
commit | 10f2d1cbf8f16c63ca3d746adb33d43f116dbb05 (patch) | |
tree | 85c6a1f74cdec7f6b7ed96064008e44bc0363871 /drivers/infiniband | |
parent | 46c87b4277f58ecb4672aa7b8a1653d81b6b9379 (diff) | |
download | linux-10f2d1cbf8f16c63ca3d746adb33d43f116dbb05.tar.gz linux-10f2d1cbf8f16c63ca3d746adb33d43f116dbb05.tar.bz2 linux-10f2d1cbf8f16c63ca3d746adb33d43f116dbb05.zip |
RDMA/usnic: Clean up usnic_ib_alloc_pd()
Remove the unnecessary "umem_pd" variable. And usnic_uiom_alloc_pd()
never returns NULL so remove the NULL check.
Link: https://lore.kernel.org/r/20211118113924.GH1147@kili
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/usnic/usnic_ib_verbs.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/infiniband/hw/usnic/usnic_ib_verbs.c b/drivers/infiniband/hw/usnic/usnic_ib_verbs.c index 756a83bcff58..5a0e26cd648e 100644 --- a/drivers/infiniband/hw/usnic/usnic_ib_verbs.c +++ b/drivers/infiniband/hw/usnic/usnic_ib_verbs.c @@ -442,12 +442,10 @@ int usnic_ib_query_gid(struct ib_device *ibdev, u32 port, int index, int usnic_ib_alloc_pd(struct ib_pd *ibpd, struct ib_udata *udata) { struct usnic_ib_pd *pd = to_upd(ibpd); - void *umem_pd; - umem_pd = pd->umem_pd = usnic_uiom_alloc_pd(); - if (IS_ERR_OR_NULL(umem_pd)) { - return umem_pd ? PTR_ERR(umem_pd) : -ENOMEM; - } + pd->umem_pd = usnic_uiom_alloc_pd(); + if (IS_ERR(pd->umem_pd)) + return PTR_ERR(pd->umem_pd); return 0; } |