Skip to contentSkip to conversation

bus: mhi: core: Fix null pointer access

PATCH Applied [email protected] 2 participants 2 messages Oct 27, 2020 – Dec 29, 2020

Subsystems (2)

v1 of 2 Applied 1/1 Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bus: mhi: core: Fix null pointer access

From: carl <[email protected]>

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

---
 drivers/bus/mhi/core/init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/bus/mhi/core/init.c +2 -2
index 0ffdebde8..c6b43e90b 100644
@@ -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;
 
Signature · 1 line
2.17.1
#1 lore raw
This patch was applied to qcom/linux.git (refs/heads/for-next):

Hello:

This patch was applied to qcom/linux.git (refs/heads/for-next):

Quoted 9 lines · On Tue, 27 Oct 2020 13:33:10 +0800 you wrote:

From: carl <[email protected]>

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

[...]

Here is the summary with links:
- bus: mhi: core: Fix null pointer access

    https://git.kernel.org/qcom/c/f4d0b39c8425

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html