bus: mhi: host: Fix potential kernel panic by calling dev_err
Subsystems (3)
PATCH v4 1/1 bus: mhi: host: Fix potential kernel panic by calling dev_err
In mhi_init_irq_setup, the device pointer used for dev_err was not initialized. Use the pointer from mhi_cntrl instead.
--- drivers/bus/mhi/host/init.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/bus/mhi/host/init.c +2 -3
@@ -194,7 +194,6 @@ static void mhi_deinit_free_irq(struct mhi_controller *mhi_cntrl)static int mhi_init_irq_setup (struct mhi_controller *mhi_cntrl) {struct mhi_event *mhi_event = mhi_cntrl->mhi_event; -struct device *dev = &mhi_cntrl->mhi_dev->dev;unsigned long irq_flags =IRQF_SHARED |IRQF_NO_SUSPEND ;int i, ret;
@@ -221,7 +220,7 @@ static int mhi_init_irq_setup(struct mhi_controller *mhi_cntrl)continue ;if (mhi_event->irq >= mhi_cntrl->nr_irqs) { -dev_err (dev,"irq %d not available for event ring\n" , +dev_err (mhi_cntrl->cntrl_dev,"irq %d not available for event ring\n" , mhi_event->irq); ret = -EINVAL ; goto error_request;
@@ -232,7 +231,7 @@ static int mhi_init_irq_setup(struct mhi_controller *mhi_cntrl) irq_flags, "mhi", mhi_event);if (ret) { -dev_err (dev,"Error requesting irq:%d for ev:%d\n" , +dev_err (mhi_cntrl->cntrl_dev,"Error requesting irq:%d for ev:%d\n" , mhi_cntrl->irq[mhi_event->irq], i); goto error_request; }
Signature · 4 lines
2.43.0 To view our privacy policy, including the types of personal information we collect, process and share, and the rights and options you have in this respect, see www.semtech.com/legal.
kernel test robot
build botFYI: kernel test robot notices the stable kernel rule is not satisfied.
Hi,
Thanks for your patch.
FYI: kernel test robot notices the stable kernel rule is not satisfied.
The check is based on https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html#option-1
Rule: add the tag "Cc: [email protected]" in the sign-off area to have the patch automatically included in the stable tree.
Subject: [PATCH v4] bus: mhi: host: Fix potential kernel panic by calling dev_err
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
Manivannan Sadhasivam
AppliedQuoted 4 lines · Adam Xue
In
mhi_init_irq_setup, the device pointer used fordev_errwas not initialized. Use the pointer frommhi_cntrlinstead.
Applied, thanks!
[1/1] bus: mhi: host: Fix potential kernel panic by calling dev_err
commit: d0856a6dff57f95cc5d2d74e50880f01697d0cc4
I've saved time by adding the tags myself.
Best regards,
Signature · 1 line
Manivannan Sadhasivam <[email protected]>