mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
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: 0cbf260820 ("bus: mhi: core: Add support for registering MHI controllers")
Signed-off-by: Carl Yin <carl.yin@quectel.com>
Reviewed-by: Bhaumik Bhatt <bbhatt@codeaurora.org>
Reviewed-by: Hemant Kumar <hemantk@codeaurora.org>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
This commit is contained in:
committed by
Manivannan Sadhasivam
parent
855a70c120
commit
f4d0b39c84
@@ -610,7 +610,7 @@ static int parse_ev_cfg(struct mhi_controller *mhi_cntrl,
|
|||||||
{
|
{
|
||||||
struct mhi_event *mhi_event;
|
struct mhi_event *mhi_event;
|
||||||
const struct mhi_event_config *event_cfg;
|
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;
|
int i, num;
|
||||||
|
|
||||||
num = config->num_events;
|
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_controller_config *config)
|
||||||
{
|
{
|
||||||
const struct mhi_channel_config *ch_cfg;
|
const struct mhi_channel_config *ch_cfg;
|
||||||
struct device *dev = &mhi_cntrl->mhi_dev->dev;
|
struct device *dev = mhi_cntrl->cntrl_dev;
|
||||||
int i;
|
int i;
|
||||||
u32 chan;
|
u32 chan;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user