bus: mhi: host: Do not use uninitialized 'dev' pointer in mhi_init_irq_setup()
commit d0856a6dff57f95cc5d2d74e50880f01697d0cc4 upstream. In mhi_init_irq_setup, the device pointer used for dev_err() was not initialized. Use the pointer from mhi_cntrl instead. Fixes:b0fc0167f2("bus: mhi: core: Allow shared IRQ for event rings") Fixes:3000f85b8f("bus: mhi: core: Add support for basic PM operations") Signed-off-by: Adam Xue <zxue@semtech.com> [mani: reworded subject/description and CCed stable] Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com> Reviewed-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com> Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20250905174118.38512-1-zxue@semtech.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
a43a2af63d
commit
94af1356de
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user