linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] bus: mhi: core: Fix null pointer access when parsing MHI configuration
@ 2020-11-02 12:27 carl.yin
  2020-11-03 22:05 ` Hemant Kumar
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: carl.yin @ 2020-11-02 12:27 UTC (permalink / raw)
  To: manivannan.sadhasivam, hemantk, sfr
  Cc: linux-arm-msm, linux-kernel, carl.yin, naveen.kumar

From: "carl.yin" <carl.yin@quectel.com>

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: 0cbf260820fa ("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>
---
 drivers/bus/mhi/core/init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/bus/mhi/core/init.c b/drivers/bus/mhi/core/init.c
index 0ffdebd..c6b43e9 100644
--- a/drivers/bus/mhi/core/init.c
+++ b/drivers/bus/mhi/core/init.c
@@ -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;
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] bus: mhi: core: Fix null pointer access when parsing MHI configuration
  2020-11-02 12:27 [PATCH v2] bus: mhi: core: Fix null pointer access when parsing MHI configuration carl.yin
@ 2020-11-03 22:05 ` Hemant Kumar
  2020-11-05 16:05 ` Manivannan Sadhasivam
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Hemant Kumar @ 2020-11-03 22:05 UTC (permalink / raw)
  To: carl.yin, manivannan.sadhasivam, sfr
  Cc: linux-arm-msm, linux-kernel, naveen.kumar



On 11/2/20 4:27 AM, carl.yin@quectel.com wrote:
> From: "carl.yin" <carl.yin@quectel.com>
> 
> 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: 0cbf260820fa ("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>
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] bus: mhi: core: Fix null pointer access when parsing MHI configuration
  2020-11-02 12:27 [PATCH v2] bus: mhi: core: Fix null pointer access when parsing MHI configuration carl.yin
  2020-11-03 22:05 ` Hemant Kumar
@ 2020-11-05 16:05 ` Manivannan Sadhasivam
  2020-11-09 12:01 ` Manivannan Sadhasivam
  2020-12-29 20:15 ` patchwork-bot+linux-arm-msm
  3 siblings, 0 replies; 5+ messages in thread
From: Manivannan Sadhasivam @ 2020-11-05 16:05 UTC (permalink / raw)
  To: carl.yin; +Cc: hemantk, sfr, linux-arm-msm, linux-kernel, naveen.kumar

On Mon, Nov 02, 2020 at 08:27:10PM +0800, carl.yin@quectel.com wrote:
> From: "carl.yin" <carl.yin@quectel.com>
> 
> 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: 0cbf260820fa ("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: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

Nit: Your name in the Signed-off-by tag should be in a proper format
like "Carl Yin". I'll fix it up while applying. But please fix it in
future patches.

Thanks,
Mani

> ---
>  drivers/bus/mhi/core/init.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/bus/mhi/core/init.c b/drivers/bus/mhi/core/init.c
> index 0ffdebd..c6b43e9 100644
> --- a/drivers/bus/mhi/core/init.c
> +++ b/drivers/bus/mhi/core/init.c
> @@ -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;
>  
> -- 
> 2.25.1
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] bus: mhi: core: Fix null pointer access when parsing MHI configuration
  2020-11-02 12:27 [PATCH v2] bus: mhi: core: Fix null pointer access when parsing MHI configuration carl.yin
  2020-11-03 22:05 ` Hemant Kumar
  2020-11-05 16:05 ` Manivannan Sadhasivam
@ 2020-11-09 12:01 ` Manivannan Sadhasivam
  2020-12-29 20:15 ` patchwork-bot+linux-arm-msm
  3 siblings, 0 replies; 5+ messages in thread
From: Manivannan Sadhasivam @ 2020-11-09 12:01 UTC (permalink / raw)
  To: carl.yin; +Cc: hemantk, sfr, linux-arm-msm, linux-kernel, naveen.kumar

On Mon, Nov 02, 2020 at 08:27:10PM +0800, carl.yin@quectel.com wrote:
> From: "carl.yin" <carl.yin@quectel.com>
> 
> 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: 0cbf260820fa ("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>

Applied to mhi-next!

Thanks,
Mani

> ---
>  drivers/bus/mhi/core/init.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/bus/mhi/core/init.c b/drivers/bus/mhi/core/init.c
> index 0ffdebd..c6b43e9 100644
> --- a/drivers/bus/mhi/core/init.c
> +++ b/drivers/bus/mhi/core/init.c
> @@ -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;
>  
> -- 
> 2.25.1
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] bus: mhi: core: Fix null pointer access when parsing MHI configuration
  2020-11-02 12:27 [PATCH v2] bus: mhi: core: Fix null pointer access when parsing MHI configuration carl.yin
                   ` (2 preceding siblings ...)
  2020-11-09 12:01 ` Manivannan Sadhasivam
@ 2020-12-29 20:15 ` patchwork-bot+linux-arm-msm
  3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+linux-arm-msm @ 2020-12-29 20:15 UTC (permalink / raw)
  To: =?utf-8?b?Q2FybCBZaW4o5q635byg5oiQKSA8Y2FybC55aW5AcXVlY3RlbC5jb20+?=
  Cc: linux-arm-msm

Hello:

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

On Mon,  2 Nov 2020 20:27:10 +0800 you wrote:
> From: "carl.yin" <carl.yin@quectel.com>
> 
> 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: 0cbf260820fa ("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>
> 
> [...]

Here is the summary with links:
  - [v2] bus: mhi: core: Fix null pointer access when parsing MHI configuration
    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



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-12-29 20:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-02 12:27 [PATCH v2] bus: mhi: core: Fix null pointer access when parsing MHI configuration carl.yin
2020-11-03 22:05 ` Hemant Kumar
2020-11-05 16:05 ` Manivannan Sadhasivam
2020-11-09 12:01 ` Manivannan Sadhasivam
2020-12-29 20:15 ` patchwork-bot+linux-arm-msm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).