Skip to content

Commit d0856a6

Browse files
Adam XueManivannan Sadhasivam
authored andcommitted
bus: mhi: host: Do not use uninitialized 'dev' pointer in mhi_init_irq_setup()
In mhi_init_irq_setup, the device pointer used for dev_err() was not initialized. Use the pointer from mhi_cntrl instead. Fixes: b0fc016 ("bus: mhi: core: Allow shared IRQ for event rings") Fixes: 3000f85 ("bus: mhi: core: Add support for basic PM operations") Signed-off-by: Adam Xue <[email protected]> [mani: reworded subject/description and CCed stable] Signed-off-by: Manivannan Sadhasivam <[email protected]> Reviewed-by: Krishna Chaitanya Chundru <[email protected]> Cc: [email protected] Link: https://patch.msgid.link/[email protected]
1 parent 376358b commit d0856a6

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/bus/mhi/host/init.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ static void mhi_deinit_free_irq(struct mhi_controller *mhi_cntrl)
194194
static int mhi_init_irq_setup(struct mhi_controller *mhi_cntrl)
195195
{
196196
struct mhi_event *mhi_event = mhi_cntrl->mhi_event;
197-
struct device *dev = &mhi_cntrl->mhi_dev->dev;
198197
unsigned long irq_flags = IRQF_SHARED | IRQF_NO_SUSPEND;
199198
int i, ret;
200199

@@ -221,7 +220,7 @@ static int mhi_init_irq_setup(struct mhi_controller *mhi_cntrl)
221220
continue;
222221

223222
if (mhi_event->irq >= mhi_cntrl->nr_irqs) {
224-
dev_err(dev, "irq %d not available for event ring\n",
223+
dev_err(mhi_cntrl->cntrl_dev, "irq %d not available for event ring\n",
225224
mhi_event->irq);
226225
ret = -EINVAL;
227226
goto error_request;
@@ -232,7 +231,7 @@ static int mhi_init_irq_setup(struct mhi_controller *mhi_cntrl)
232231
irq_flags,
233232
"mhi", mhi_event);
234233
if (ret) {
235-
dev_err(dev, "Error requesting irq:%d for ev:%d\n",
234+
dev_err(mhi_cntrl->cntrl_dev, "Error requesting irq:%d for ev:%d\n",
236235
mhi_cntrl->irq[mhi_event->irq], i);
237236
goto error_request;
238237
}

0 commit comments

Comments
 (0)