mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 22:14:03 +02:00
RDMA/bnxt_re: check create_singlethread_workqueue() in DCB setup
bnxt_re_init_dcb_wq() ignores a failed allocation. The async DCB
handler later calls queue_work() on the NULL pointer.
Fixes: 51dc5312dc ("RDMA/bnxt_re: Add support to handle DCB_CONFIG_CHANGE event")
Signed-off-by: Linkai Gong <gonglinkai@kylinos.cn>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
This commit is contained in:
parent
a8fe3dfce8
commit
6c368f7baa
|
|
@ -356,9 +356,13 @@ static int bnxt_re_update_qp1_tos_dscp(struct bnxt_re_dev *rdev)
|
|||
return bnxt_qplib_modify_qp(&rdev->qplib_res, &qp->qplib_qp);
|
||||
}
|
||||
|
||||
static void bnxt_re_init_dcb_wq(struct bnxt_re_dev *rdev)
|
||||
static int bnxt_re_init_dcb_wq(struct bnxt_re_dev *rdev)
|
||||
{
|
||||
rdev->dcb_wq = create_singlethread_workqueue("bnxt_re_dcb_wq");
|
||||
if (!rdev->dcb_wq)
|
||||
return -ENOMEM;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void bnxt_re_uninit_dcb_wq(struct bnxt_re_dev *rdev)
|
||||
|
|
@ -2339,7 +2343,9 @@ static int bnxt_re_dev_init(struct bnxt_re_dev *rdev, u8 op_type)
|
|||
}
|
||||
bnxt_re_debugfs_add_pdev(rdev);
|
||||
|
||||
bnxt_re_init_dcb_wq(rdev);
|
||||
rc = bnxt_re_init_dcb_wq(rdev);
|
||||
if (rc)
|
||||
goto fail;
|
||||
bnxt_re_net_register_async_event(rdev);
|
||||
|
||||
if (!rdev->is_virtfn)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user