* [PATCH][next] RDMA: fix allocation failure on pointer pd
@ 2019-02-12 11:22 Colin King
2019-02-12 11:29 ` Leon Romanovsky
2019-02-12 20:56 ` Jason Gunthorpe
0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2019-02-12 11:22 UTC (permalink / raw)
To: Leon Romanovsky, Lijun Ou, Wei Hu, Doug Ledford, Jason Gunthorpe,
linux-rdma
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The null check on an allocation failure on pd is currently checking
if pd is non-null rather than null. Fix this by adding the missing !
operator.
Fixes: 21a428a019c9 ("RDMA: Handle PD allocations by IB/core")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
index a18b88c95995..77c3678f4829 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
@@ -745,7 +745,7 @@ static int hns_roce_v1_rsv_lp_qp(struct hns_roce_dev *hr_dev)
ibdev = &hr_dev->ib_dev;
pd = rdma_zalloc_drv_obj(ibdev, ib_pd);
- if (pd)
+ if (!pd)
goto alloc_mem_failed;
pd->device = ibdev;
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH][next] RDMA: fix allocation failure on pointer pd
2019-02-12 11:22 [PATCH][next] RDMA: fix allocation failure on pointer pd Colin King
@ 2019-02-12 11:29 ` Leon Romanovsky
2019-02-12 20:56 ` Jason Gunthorpe
1 sibling, 0 replies; 3+ messages in thread
From: Leon Romanovsky @ 2019-02-12 11:29 UTC (permalink / raw)
To: Colin King
Cc: Lijun Ou, Wei Hu, Doug Ledford, Jason Gunthorpe,
linux-rdma@vger.kernel.org, kernel-janitors@vger.kernel.org,
linux-kernel@vger.kernel.org
On Tue, Feb 12, 2019 at 11:22:33AM +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The null check on an allocation failure on pd is currently checking
> if pd is non-null rather than null. Fix this by adding the missing !
> operator.
>
> Fixes: 21a428a019c9 ("RDMA: Handle PD allocations by IB/core")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Thanks a lot,
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH][next] RDMA: fix allocation failure on pointer pd
2019-02-12 11:22 [PATCH][next] RDMA: fix allocation failure on pointer pd Colin King
2019-02-12 11:29 ` Leon Romanovsky
@ 2019-02-12 20:56 ` Jason Gunthorpe
1 sibling, 0 replies; 3+ messages in thread
From: Jason Gunthorpe @ 2019-02-12 20:56 UTC (permalink / raw)
To: Colin King
Cc: Leon Romanovsky, Lijun Ou, Wei Hu, Doug Ledford, linux-rdma,
kernel-janitors, linux-kernel
On Tue, Feb 12, 2019 at 11:22:33AM +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The null check on an allocation failure on pd is currently checking
> if pd is non-null rather than null. Fix this by adding the missing !
> operator.
>
> Fixes: 21a428a019c9 ("RDMA: Handle PD allocations by IB/core")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
> ---
> drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Thanks applied to for-next
Regards,
Jason
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-02-12 20:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-12 11:22 [PATCH][next] RDMA: fix allocation failure on pointer pd Colin King
2019-02-12 11:29 ` Leon Romanovsky
2019-02-12 20:56 ` Jason Gunthorpe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox