Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
* [PATCH] rpmsg: qcom_smd: Fix uninitialized return variable in __qcom_smd_send()
       [not found] <CA+G9fYs+z4-aCriaGHnrU=5A14cQskg=TMxzQ5MKxvjq_zCX6g@mail.gmail.com>
@ 2025-04-23 17:22 ` Dan Carpenter
  2025-04-24  7:02   ` Abel Vesa
                     ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Dan Carpenter @ 2025-04-23 17:22 UTC (permalink / raw)
  To: Bjorn Andersson, Naresh Kamboju
  Cc: Mathieu Poirier, linux-arm-msm, linux-remoteproc, linux-kernel,
	kernel-janitors, Greg Kroah-Hartman, stable, patches, torvalds,
	akpm, linux, shuah, patches, lkft-triage, pavel, jonathanh,
	f.fainelli, sudipm.mukherjee, srw, rwarsow, conor, hargar,
	broonie, Arnd Bergmann, Liam Girdwood, Frieder Schrempf,
	Marek Vasut, Anders Roxell

The "ret" variable isn't initialized if we don't enter the loop.  For
example,  if "channel->state" is not SMD_CHANNEL_OPENED.

Fixes: 33e3820dda88 ("rpmsg: smd: Use spinlock in tx path")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
Naresh, could you test this patch and see if it fixes the boot
problems you saw?

 drivers/rpmsg/qcom_smd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rpmsg/qcom_smd.c b/drivers/rpmsg/qcom_smd.c
index 40d386809d6b..bb161def3175 100644
--- a/drivers/rpmsg/qcom_smd.c
+++ b/drivers/rpmsg/qcom_smd.c
@@ -746,7 +746,7 @@ static int __qcom_smd_send(struct qcom_smd_channel *channel, const void *data,
 	__le32 hdr[5] = { cpu_to_le32(len), };
 	int tlen = sizeof(hdr) + len;
 	unsigned long flags;
-	int ret;
+	int ret = 0;
 
 	/* Word aligned channels only accept word size aligned data */
 	if (channel->info_word && len % 4)
-- 
2.47.2


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

* Re: [PATCH] rpmsg: qcom_smd: Fix uninitialized return variable in __qcom_smd_send()
  2025-04-23 17:22 ` [PATCH] rpmsg: qcom_smd: Fix uninitialized return variable in __qcom_smd_send() Dan Carpenter
@ 2025-04-24  7:02   ` Abel Vesa
  2025-04-25  6:06   ` Naresh Kamboju
  2025-05-08  6:40   ` Dan Carpenter
  2 siblings, 0 replies; 8+ messages in thread
From: Abel Vesa @ 2025-04-24  7:02 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Bjorn Andersson, Naresh Kamboju, Mathieu Poirier, linux-arm-msm,
	linux-remoteproc, linux-kernel, kernel-janitors,
	Greg Kroah-Hartman, stable, patches, torvalds, akpm, linux, shuah,
	patches, lkft-triage, pavel, jonathanh, f.fainelli,
	sudipm.mukherjee, srw, rwarsow, conor, hargar, broonie,
	Arnd Bergmann, Liam Girdwood, Frieder Schrempf, Marek Vasut,
	Anders Roxell

On 25-04-23 20:22:05, Dan Carpenter wrote:
> The "ret" variable isn't initialized if we don't enter the loop.  For
> example,  if "channel->state" is not SMD_CHANNEL_OPENED.
> 
> Fixes: 33e3820dda88 ("rpmsg: smd: Use spinlock in tx path")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Reviewed-by: Abel Vesa <abel.vesa@linaro.org>

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

* Re: [PATCH] rpmsg: qcom_smd: Fix uninitialized return variable in __qcom_smd_send()
  2025-04-23 17:22 ` [PATCH] rpmsg: qcom_smd: Fix uninitialized return variable in __qcom_smd_send() Dan Carpenter
  2025-04-24  7:02   ` Abel Vesa
@ 2025-04-25  6:06   ` Naresh Kamboju
  2025-04-25  8:17     ` Dan Carpenter
  2025-05-08  6:40   ` Dan Carpenter
  2 siblings, 1 reply; 8+ messages in thread
From: Naresh Kamboju @ 2025-04-25  6:06 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Bjorn Andersson, Mathieu Poirier, linux-arm-msm, linux-remoteproc,
	linux-kernel, kernel-janitors, Greg Kroah-Hartman, stable,
	patches, torvalds, akpm, linux, shuah, patches, lkft-triage,
	pavel, jonathanh, f.fainelli, sudipm.mukherjee, srw, rwarsow,
	conor, hargar, broonie, Arnd Bergmann, Liam Girdwood,
	Frieder Schrempf, Marek Vasut, Anders Roxell

On Wed, 23 Apr 2025 at 22:52, Dan Carpenter <dan.carpenter@linaro.org> wrote:
>
> The "ret" variable isn't initialized if we don't enter the loop.  For
> example,  if "channel->state" is not SMD_CHANNEL_OPENED.
>
> Fixes: 33e3820dda88 ("rpmsg: smd: Use spinlock in tx path")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> Naresh, could you test this patch and see if it fixes the boot
> problems you saw?

Dan, This patch fixes the reported problem.

Tested-by: Naresh Kamboju <naresh.kamboju@linaro.org>

Links:
 - https://lkft.validation.linaro.org/scheduler/job/8244118#L2441

>
>  drivers/rpmsg/qcom_smd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/rpmsg/qcom_smd.c b/drivers/rpmsg/qcom_smd.c
> index 40d386809d6b..bb161def3175 100644
> --- a/drivers/rpmsg/qcom_smd.c
> +++ b/drivers/rpmsg/qcom_smd.c
> @@ -746,7 +746,7 @@ static int __qcom_smd_send(struct qcom_smd_channel *channel, const void *data,
>         __le32 hdr[5] = { cpu_to_le32(len), };
>         int tlen = sizeof(hdr) + len;
>         unsigned long flags;
> -       int ret;
> +       int ret = 0;
>
>         /* Word aligned channels only accept word size aligned data */
>         if (channel->info_word && len % 4)
> --
> 2.47.2
>

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

* Re: [PATCH] rpmsg: qcom_smd: Fix uninitialized return variable in __qcom_smd_send()
  2025-04-25  6:06   ` Naresh Kamboju
@ 2025-04-25  8:17     ` Dan Carpenter
  0 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2025-04-25  8:17 UTC (permalink / raw)
  To: Naresh Kamboju
  Cc: Bjorn Andersson, Mathieu Poirier, linux-arm-msm, linux-remoteproc,
	linux-kernel, kernel-janitors, Greg Kroah-Hartman, stable,
	patches, torvalds, akpm, linux, shuah, patches, lkft-triage,
	pavel, jonathanh, f.fainelli, sudipm.mukherjee, srw, rwarsow,
	conor, hargar, broonie, Arnd Bergmann, Liam Girdwood,
	Frieder Schrempf, Marek Vasut, Anders Roxell

On Fri, Apr 25, 2025 at 11:36:24AM +0530, Naresh Kamboju wrote:
> On Wed, 23 Apr 2025 at 22:52, Dan Carpenter <dan.carpenter@linaro.org> wrote:
> >
> > The "ret" variable isn't initialized if we don't enter the loop.  For
> > example,  if "channel->state" is not SMD_CHANNEL_OPENED.
> >
> > Fixes: 33e3820dda88 ("rpmsg: smd: Use spinlock in tx path")
> > Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> > ---
> > Naresh, could you test this patch and see if it fixes the boot
> > problems you saw?
> 
> Dan, This patch fixes the reported problem.
> 
> Tested-by: Naresh Kamboju <naresh.kamboju@linaro.org>
> 

Thanks Naresh,

I left off your reported by tag as well.

Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>

regards,
dan carpenter


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

* Re: [PATCH] rpmsg: qcom_smd: Fix uninitialized return variable in __qcom_smd_send()
  2025-04-23 17:22 ` [PATCH] rpmsg: qcom_smd: Fix uninitialized return variable in __qcom_smd_send() Dan Carpenter
  2025-04-24  7:02   ` Abel Vesa
  2025-04-25  6:06   ` Naresh Kamboju
@ 2025-05-08  6:40   ` Dan Carpenter
  2025-05-08  6:46     ` Greg Kroah-Hartman
  2 siblings, 1 reply; 8+ messages in thread
From: Dan Carpenter @ 2025-05-08  6:40 UTC (permalink / raw)
  To: Bjorn Andersson, Naresh Kamboju
  Cc: Mathieu Poirier, linux-arm-msm, linux-remoteproc, linux-kernel,
	kernel-janitors, Greg Kroah-Hartman, stable, patches, torvalds,
	akpm, linux, shuah, patches, lkft-triage, pavel, jonathanh,
	f.fainelli, sudipm.mukherjee, srw, rwarsow, conor, hargar,
	broonie, Arnd Bergmann, Liam Girdwood, Frieder Schrempf,
	Marek Vasut, Anders Roxell

Hi Greg,

I'm sorry I forgot to add the:

Cc: stable@vger.kernel.org

to this patch.  Could we backport it to stable, please?

regards,
dan carpenter

On Wed, Apr 23, 2025 at 08:22:05PM +0300, Dan Carpenter wrote:
> The "ret" variable isn't initialized if we don't enter the loop.  For
> example,  if "channel->state" is not SMD_CHANNEL_OPENED.
> 
> Fixes: 33e3820dda88 ("rpmsg: smd: Use spinlock in tx path")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> Naresh, could you test this patch and see if it fixes the boot
> problems you saw?
> 
>  drivers/rpmsg/qcom_smd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/rpmsg/qcom_smd.c b/drivers/rpmsg/qcom_smd.c
> index 40d386809d6b..bb161def3175 100644
> --- a/drivers/rpmsg/qcom_smd.c
> +++ b/drivers/rpmsg/qcom_smd.c
> @@ -746,7 +746,7 @@ static int __qcom_smd_send(struct qcom_smd_channel *channel, const void *data,
>  	__le32 hdr[5] = { cpu_to_le32(len), };
>  	int tlen = sizeof(hdr) + len;
>  	unsigned long flags;
> -	int ret;
> +	int ret = 0;
>  
>  	/* Word aligned channels only accept word size aligned data */
>  	if (channel->info_word && len % 4)
> -- 
> 2.47.2

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

* Re: [PATCH] rpmsg: qcom_smd: Fix uninitialized return variable in __qcom_smd_send()
  2025-05-08  6:40   ` Dan Carpenter
@ 2025-05-08  6:46     ` Greg Kroah-Hartman
  2025-05-08  6:48       ` Dan Carpenter
  0 siblings, 1 reply; 8+ messages in thread
From: Greg Kroah-Hartman @ 2025-05-08  6:46 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Bjorn Andersson, Naresh Kamboju, Mathieu Poirier, linux-arm-msm,
	linux-remoteproc, linux-kernel, kernel-janitors, stable, patches,
	torvalds, akpm, linux, shuah, patches, lkft-triage, pavel,
	jonathanh, f.fainelli, sudipm.mukherjee, srw, rwarsow, conor,
	hargar, broonie, Arnd Bergmann, Liam Girdwood, Frieder Schrempf,
	Marek Vasut, Anders Roxell

On Thu, May 08, 2025 at 09:40:26AM +0300, Dan Carpenter wrote:
> Hi Greg,
> 
> I'm sorry I forgot to add the:
> 
> Cc: stable@vger.kernel.org
> 
> to this patch.  Could we backport it to stable, please?

What is the git id of it in Linus's tree?

thanks,

greg k-h

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

* Re: [PATCH] rpmsg: qcom_smd: Fix uninitialized return variable in __qcom_smd_send()
  2025-05-08  6:46     ` Greg Kroah-Hartman
@ 2025-05-08  6:48       ` Dan Carpenter
  2025-05-08  6:50         ` Dan Carpenter
  0 siblings, 1 reply; 8+ messages in thread
From: Dan Carpenter @ 2025-05-08  6:48 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Bjorn Andersson, Naresh Kamboju, Mathieu Poirier, linux-arm-msm,
	linux-remoteproc, linux-kernel, kernel-janitors, stable, patches,
	torvalds, akpm, linux, shuah, patches, lkft-triage, pavel,
	jonathanh, f.fainelli, sudipm.mukherjee, srw, rwarsow, conor,
	hargar, broonie, Arnd Bergmann, Liam Girdwood, Frieder Schrempf,
	Marek Vasut, Anders Roxell

On Thu, May 08, 2025 at 08:46:04AM +0200, Greg Kroah-Hartman wrote:
> On Thu, May 08, 2025 at 09:40:26AM +0300, Dan Carpenter wrote:
> > Hi Greg,
> > 
> > I'm sorry I forgot to add the:
> > 
> > Cc: stable@vger.kernel.org
> > 
> > to this patch.  Could we backport it to stable, please?
> 
> What is the git id of it in Linus's tree?
> 

77feb17c950e ("rpmsg: qcom_smd: Fix uninitialized return variable in __qcom_smd_send()")

regards,
dan carpenter


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

* Re: [PATCH] rpmsg: qcom_smd: Fix uninitialized return variable in __qcom_smd_send()
  2025-05-08  6:48       ` Dan Carpenter
@ 2025-05-08  6:50         ` Dan Carpenter
  0 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2025-05-08  6:50 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Bjorn Andersson, Naresh Kamboju, Mathieu Poirier, linux-arm-msm,
	linux-remoteproc, linux-kernel, kernel-janitors, stable, patches,
	torvalds, akpm, linux, shuah, patches, lkft-triage, pavel,
	jonathanh, f.fainelli, sudipm.mukherjee, srw, rwarsow, conor,
	hargar, broonie, Arnd Bergmann, Liam Girdwood, Frieder Schrempf,
	Marek Vasut, Anders Roxell

On Thu, May 08, 2025 at 09:48:34AM +0300, Dan Carpenter wrote:
> On Thu, May 08, 2025 at 08:46:04AM +0200, Greg Kroah-Hartman wrote:
> > On Thu, May 08, 2025 at 09:40:26AM +0300, Dan Carpenter wrote:
> > > Hi Greg,
> > > 
> > > I'm sorry I forgot to add the:
> > > 
> > > Cc: stable@vger.kernel.org
> > > 
> > > to this patch.  Could we backport it to stable, please?
> > 
> > What is the git id of it in Linus's tree?
> > 
> 
> 77feb17c950e ("rpmsg: qcom_smd: Fix uninitialized return variable in __qcom_smd_send()")
>

Ugh.  Nope.  It hasn't hit Linus's tree yet.

regards,
dan carpenter


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

end of thread, other threads:[~2025-05-08  6:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CA+G9fYs+z4-aCriaGHnrU=5A14cQskg=TMxzQ5MKxvjq_zCX6g@mail.gmail.com>
2025-04-23 17:22 ` [PATCH] rpmsg: qcom_smd: Fix uninitialized return variable in __qcom_smd_send() Dan Carpenter
2025-04-24  7:02   ` Abel Vesa
2025-04-25  6:06   ` Naresh Kamboju
2025-04-25  8:17     ` Dan Carpenter
2025-05-08  6:40   ` Dan Carpenter
2025-05-08  6:46     ` Greg Kroah-Hartman
2025-05-08  6:48       ` Dan Carpenter
2025-05-08  6:50         ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox