Skip to content

Commit

Permalink
i3c master: fix missing destroy_workqueue() on error in i3c_master_re…
Browse files Browse the repository at this point in the history
…gister

Add the missing destroy_workqueue() before return from
i3c_master_register in the error handling case.

Signed-off-by: Qinglang Miao <[email protected]>
Signed-off-by: Boris Brezillon <[email protected]>
Link: https://lore.kernel.org/linux-i3c/[email protected]
  • Loading branch information
Qinglang Miao authored and bbrezillon committed Nov 23, 2020
1 parent 3650b22 commit 59165d1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/i3c/master.c
Original file line number Diff line number Diff line change
Expand Up @@ -2537,7 +2537,7 @@ int i3c_master_register(struct i3c_master_controller *master,

ret = i3c_master_bus_init(master);
if (ret)
goto err_put_dev;
goto err_destroy_wq;

ret = device_add(&master->dev);
if (ret)
Expand Down Expand Up @@ -2568,6 +2568,9 @@ int i3c_master_register(struct i3c_master_controller *master,
err_cleanup_bus:
i3c_master_bus_cleanup(master);

err_destroy_wq:
destroy_workqueue(master->wq);

err_put_dev:
put_device(&master->dev);

Expand Down

0 comments on commit 59165d1

Please sign in to comment.