linux/drivers/bus/mhi/core
Dan Carpenter 89828f632d bus: mhi: core: Fix error handling in mhi_register_controller()
There are a few problems with the error handling in this function.  They
mostly center around the alloc_ordered_workqueue() allocation.
1) If that allocation fails or if the kcalloc() prior to it fails then
it leads to a NULL dereference when we call
destroy_workqueue(mhi_cntrl->hiprio_wq).
2) The error code is not set.
3) The "mhi_cntrl->mhi_cmd" allocation is not freed.

The error handling was slightly confusing and I re-ordered it to be in
the exact mirror/reverse order of how things were allocated.  I changed
the label names to say what the goto does instead of describing where
the goto comes from.

Fixes: 8f70397876 ("bus: mhi: core: Move to using high priority workqueue")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Loic Poulain <loic.poulain@linaro.org>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
2020-12-01 19:07:10 +05:30
..
boot.c bus: mhi: core: Use appropriate label in firmware load handler API 2020-11-18 15:20:34 +05:30
debugfs.c bus: mhi: core: Fix device hierarchy 2020-11-28 12:00:49 +05:30
init.c bus: mhi: core: Fix error handling in mhi_register_controller() 2020-12-01 19:07:10 +05:30
internal.h Merge branch 'mhi-ath11k-immutable' into mhi-next 2020-11-20 11:56:55 +05:30
main.c bus: mhi: core: Indexed MHI controller name 2020-11-28 11:55:24 +05:30
Makefile bus: mhi: core: Fix the building of MHI module 2020-10-02 11:33:47 +02:00
pm.c bus: mhi: core: Fix device hierarchy 2020-11-28 12:00:49 +05:30