Commit f4d0b39c authored by Carl Yin's avatar Carl Yin Committed by Manivannan Sadhasivam

bus: mhi: core: Fix null pointer access when parsing MHI configuration

Functions parse_ev_cfg() and parse_ch_cfg() access mhi_cntrl->mhi_dev
before it is set in function mhi_register_controller(),
use cntrl_dev instead of mhi_dev.

Fixes: 0cbf2608 ("bus: mhi: core: Add support for registering MHI controllers")
Signed-off-by: default avatarCarl Yin <carl.yin@quectel.com>
Reviewed-by: default avatarBhaumik Bhatt <bbhatt@codeaurora.org>
Reviewed-by: default avatarHemant Kumar <hemantk@codeaurora.org>
Reviewed-by: default avatarManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: default avatarManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
parent 855a70c1
......@@ -610,7 +610,7 @@ static int parse_ev_cfg(struct mhi_controller *mhi_cntrl,
{
struct mhi_event *mhi_event;
const struct mhi_event_config *event_cfg;
struct device *dev = &mhi_cntrl->mhi_dev->dev;
struct device *dev = mhi_cntrl->cntrl_dev;
int i, num;
num = config->num_events;
......@@ -692,7 +692,7 @@ static int parse_ch_cfg(struct mhi_controller *mhi_cntrl,
const struct mhi_controller_config *config)
{
const struct mhi_channel_config *ch_cfg;
struct device *dev = &mhi_cntrl->mhi_dev->dev;
struct device *dev = mhi_cntrl->cntrl_dev;
int i;
u32 chan;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment