LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] RDMA/bnxt_re: Remove redundant unlock in bnxt_re_dev_init
@ 2021-08-16 8:55 Dinghao Liu
2021-08-16 9:16 ` Selvin Xavier
2021-08-19 18:02 ` Jason Gunthorpe
0 siblings, 2 replies; 3+ messages in thread
From: Dinghao Liu @ 2021-08-16 8:55 UTC (permalink / raw)
To: dinghao.liu, kjlu
Cc: Selvin Xavier, Naresh Kumar PBS, Doug Ledford, Jason Gunthorpe,
linux-rdma, linux-kernel
Commit c2b777a95923 removes all rtnl_lock() and rtnl_unlock()
in function bnxt_re_dev_init(), but forgets to remove a rtnl_unlock()
in the error handling path of bnxt_re_register_netdev(), which may
cause a deadlock. This bug is suggested by a static analysis tool,
please advise.
Fixes: c2b777a95923 ("RDMA/bnxt_re: Refactor device add/remove functionalities")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
---
drivers/infiniband/hw/bnxt_re/main.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/infiniband/hw/bnxt_re/main.c b/drivers/infiniband/hw/bnxt_re/main.c
index a8688a92c760..4678bd6ec7d6 100644
--- a/drivers/infiniband/hw/bnxt_re/main.c
+++ b/drivers/infiniband/hw/bnxt_re/main.c
@@ -1397,7 +1397,6 @@ static int bnxt_re_dev_init(struct bnxt_re_dev *rdev, u8 wqe_mode)
memset(&rattr, 0, sizeof(rattr));
rc = bnxt_re_register_netdev(rdev);
if (rc) {
- rtnl_unlock();
ibdev_err(&rdev->ibdev,
"Failed to register with netedev: %#x\n", rc);
return -EINVAL;
--
2.17.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] RDMA/bnxt_re: Remove redundant unlock in bnxt_re_dev_init
2021-08-16 8:55 [PATCH] RDMA/bnxt_re: Remove redundant unlock in bnxt_re_dev_init Dinghao Liu
@ 2021-08-16 9:16 ` Selvin Xavier
2021-08-19 18:02 ` Jason Gunthorpe
1 sibling, 0 replies; 3+ messages in thread
From: Selvin Xavier @ 2021-08-16 9:16 UTC (permalink / raw)
To: Dinghao Liu
Cc: kjlu, Naresh Kumar PBS, Doug Ledford, Jason Gunthorpe,
linux-rdma, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 562 bytes --]
On Mon, Aug 16, 2021 at 2:26 PM Dinghao Liu <dinghao.liu@zju.edu.cn> wrote:
>
> Commit c2b777a95923 removes all rtnl_lock() and rtnl_unlock()
> in function bnxt_re_dev_init(), but forgets to remove a rtnl_unlock()
> in the error handling path of bnxt_re_register_netdev(), which may
> cause a deadlock. This bug is suggested by a static analysis tool,
> please advise.
>
> Fixes: c2b777a95923 ("RDMA/bnxt_re: Refactor device add/remove functionalities")
> Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Acked-by: Selvin Xavier <selvin.xavier@broadcom.com>
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4224 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] RDMA/bnxt_re: Remove redundant unlock in bnxt_re_dev_init
2021-08-16 8:55 [PATCH] RDMA/bnxt_re: Remove redundant unlock in bnxt_re_dev_init Dinghao Liu
2021-08-16 9:16 ` Selvin Xavier
@ 2021-08-19 18:02 ` Jason Gunthorpe
1 sibling, 0 replies; 3+ messages in thread
From: Jason Gunthorpe @ 2021-08-19 18:02 UTC (permalink / raw)
To: Dinghao Liu
Cc: kjlu, Selvin Xavier, Naresh Kumar PBS, Doug Ledford, linux-rdma,
linux-kernel
On Mon, Aug 16, 2021 at 04:55:31PM +0800, Dinghao Liu wrote:
> Commit c2b777a95923 removes all rtnl_lock() and rtnl_unlock()
> in function bnxt_re_dev_init(), but forgets to remove a rtnl_unlock()
> in the error handling path of bnxt_re_register_netdev(), which may
> cause a deadlock. This bug is suggested by a static analysis tool,
> please advise.
>
> Fixes: c2b777a95923 ("RDMA/bnxt_re: Refactor device add/remove functionalities")
> Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
> Acked-by: Selvin Xavier <selvin.xavier@broadcom.com>
> ---
> drivers/infiniband/hw/bnxt_re/main.c | 1 -
> 1 file changed, 1 deletion(-)
Applied to for-rc, thanks
Jason
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-08-19 18:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-16 8:55 [PATCH] RDMA/bnxt_re: Remove redundant unlock in bnxt_re_dev_init Dinghao Liu
2021-08-16 9:16 ` Selvin Xavier
2021-08-19 18:02 ` Jason Gunthorpe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).