public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bus: fsl-mc: Fix test for end of loop
@ 2021-02-01 12:28 Dan Carpenter
  2021-02-02 12:36 ` Ioana Ciornei
  2021-02-08 14:18 ` Ioana Ciornei
  0 siblings, 2 replies; 5+ messages in thread
From: Dan Carpenter @ 2021-02-01 12:28 UTC (permalink / raw)
  To: Stuart Yoder, Ioana Ciornei
  Cc: Laurentiu Tudor, linux-kernel, kernel-janitors

The "desc" pointer can't possibly be NULL here.  If we can't find the
correct "desc" then tt points to the last element of the
fsl_mc_accepted_cmds[] array.  Fix this by testing if
"i == FSL_MC_NUM_ACCEPTED_CMDS" instead.

Fixes: 2cf1e703f066 ("bus: fsl-mc: add fsl-mc userspace support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/bus/fsl-mc/fsl-mc-uapi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bus/fsl-mc/fsl-mc-uapi.c b/drivers/bus/fsl-mc/fsl-mc-uapi.c
index eeb988c9f4bb..bdcd9d983a78 100644
--- a/drivers/bus/fsl-mc/fsl-mc-uapi.c
+++ b/drivers/bus/fsl-mc/fsl-mc-uapi.c
@@ -338,7 +338,7 @@ static int fsl_mc_command_check(struct fsl_mc_device *mc_dev,
 		if ((cmdid & desc->cmdid_mask) == desc->cmdid_value)
 			break;
 	}
-	if (!desc) {
+	if (i == FSL_MC_NUM_ACCEPTED_CMDS) {
 		dev_err(&mc_dev->dev, "MC command 0x%04x: cmdid not accepted\n", cmdid);
 		return -EACCES;
 	}
-- 
2.29.2


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

* Re: [PATCH] bus: fsl-mc: Fix test for end of loop
  2021-02-01 12:28 [PATCH] bus: fsl-mc: Fix test for end of loop Dan Carpenter
@ 2021-02-02 12:36 ` Ioana Ciornei
  2021-02-08 14:18 ` Ioana Ciornei
  1 sibling, 0 replies; 5+ messages in thread
From: Ioana Ciornei @ 2021-02-02 12:36 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Stuart Yoder, Laurentiu Tudor, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org

On Mon, Feb 01, 2021 at 03:28:54PM +0300, Dan Carpenter wrote:
> The "desc" pointer can't possibly be NULL here.  If we can't find the
> correct "desc" then tt points to the last element of the
> fsl_mc_accepted_cmds[] array.  Fix this by testing if
> "i == FSL_MC_NUM_ACCEPTED_CMDS" instead.
> 
> Fixes: 2cf1e703f066 ("bus: fsl-mc: add fsl-mc userspace support")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Ioana Ciornei <ioana.ciornei@nxp.com>

Thanks!

> ---
>  drivers/bus/fsl-mc/fsl-mc-uapi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/bus/fsl-mc/fsl-mc-uapi.c b/drivers/bus/fsl-mc/fsl-mc-uapi.c
> index eeb988c9f4bb..bdcd9d983a78 100644
> --- a/drivers/bus/fsl-mc/fsl-mc-uapi.c
> +++ b/drivers/bus/fsl-mc/fsl-mc-uapi.c
> @@ -338,7 +338,7 @@ static int fsl_mc_command_check(struct fsl_mc_device *mc_dev,
>  		if ((cmdid & desc->cmdid_mask) == desc->cmdid_value)
>  			break;
>  	}
> -	if (!desc) {
> +	if (i == FSL_MC_NUM_ACCEPTED_CMDS) {
>  		dev_err(&mc_dev->dev, "MC command 0x%04x: cmdid not accepted\n", cmdid);
>  		return -EACCES;
>  	}
> -- 
> 2.29.2
> 

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

* Re: [PATCH] bus: fsl-mc: Fix test for end of loop
  2021-02-01 12:28 [PATCH] bus: fsl-mc: Fix test for end of loop Dan Carpenter
  2021-02-02 12:36 ` Ioana Ciornei
@ 2021-02-08 14:18 ` Ioana Ciornei
  2021-02-08 15:11   ` Dan Carpenter
  1 sibling, 1 reply; 5+ messages in thread
From: Ioana Ciornei @ 2021-02-08 14:18 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Stuart Yoder, Laurentiu Tudor, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org

On Mon, Feb 01, 2021 at 03:28:54PM +0300, Dan Carpenter wrote:
> The "desc" pointer can't possibly be NULL here.  If we can't find the
> correct "desc" then tt points to the last element of the
> fsl_mc_accepted_cmds[] array.  Fix this by testing if
> "i == FSL_MC_NUM_ACCEPTED_CMDS" instead.
> 
> Fixes: 2cf1e703f066 ("bus: fsl-mc: add fsl-mc userspace support")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Hi,

I just noticed that Greg wasn't copied on the initial email.

If you don't mind I will re-submit your patch along with other updates
to the fsl-mc bus so that you don't have to bother.

Ioana

> ---
>  drivers/bus/fsl-mc/fsl-mc-uapi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/bus/fsl-mc/fsl-mc-uapi.c b/drivers/bus/fsl-mc/fsl-mc-uapi.c
> index eeb988c9f4bb..bdcd9d983a78 100644
> --- a/drivers/bus/fsl-mc/fsl-mc-uapi.c
> +++ b/drivers/bus/fsl-mc/fsl-mc-uapi.c
> @@ -338,7 +338,7 @@ static int fsl_mc_command_check(struct fsl_mc_device *mc_dev,
>  		if ((cmdid & desc->cmdid_mask) == desc->cmdid_value)
>  			break;
>  	}
> -	if (!desc) {
> +	if (i == FSL_MC_NUM_ACCEPTED_CMDS) {
>  		dev_err(&mc_dev->dev, "MC command 0x%04x: cmdid not accepted\n", cmdid);
>  		return -EACCES;
>  	}
> -- 
> 2.29.2
> 

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

* Re: [PATCH] bus: fsl-mc: Fix test for end of loop
  2021-02-08 14:18 ` Ioana Ciornei
@ 2021-02-08 15:11   ` Dan Carpenter
  2021-02-08 15:49     ` Ioana Ciornei
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2021-02-08 15:11 UTC (permalink / raw)
  To: Ioana Ciornei
  Cc: Stuart Yoder, Laurentiu Tudor, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org

On Mon, Feb 08, 2021 at 02:18:04PM +0000, Ioana Ciornei wrote:
> On Mon, Feb 01, 2021 at 03:28:54PM +0300, Dan Carpenter wrote:
> > The "desc" pointer can't possibly be NULL here.  If we can't find the
> > correct "desc" then tt points to the last element of the
> > fsl_mc_accepted_cmds[] array.  Fix this by testing if
> > "i == FSL_MC_NUM_ACCEPTED_CMDS" instead.
> > 
> > Fixes: 2cf1e703f066 ("bus: fsl-mc: add fsl-mc userspace support")
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> Hi,
> 
> I just noticed that Greg wasn't copied on the initial email.
> 
> If you don't mind I will re-submit your patch along with other updates
> to the fsl-mc bus so that you don't have to bother.
> 

Thanks for doing that!

Was Greg supposed to have been copied, though?  He's not listed in the
./scripts/get_maintainer.pl output.

regards,
dan carpenter


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

* Re: [PATCH] bus: fsl-mc: Fix test for end of loop
  2021-02-08 15:11   ` Dan Carpenter
@ 2021-02-08 15:49     ` Ioana Ciornei
  0 siblings, 0 replies; 5+ messages in thread
From: Ioana Ciornei @ 2021-02-08 15:49 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Stuart Yoder, Laurentiu Tudor, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org

On Mon, Feb 08, 2021 at 06:11:29PM +0300, Dan Carpenter wrote:
> On Mon, Feb 08, 2021 at 02:18:04PM +0000, Ioana Ciornei wrote:
> > On Mon, Feb 01, 2021 at 03:28:54PM +0300, Dan Carpenter wrote:
> > > The "desc" pointer can't possibly be NULL here.  If we can't find the
> > > correct "desc" then tt points to the last element of the
> > > fsl_mc_accepted_cmds[] array.  Fix this by testing if
> > > "i == FSL_MC_NUM_ACCEPTED_CMDS" instead.
> > > 
> > > Fixes: 2cf1e703f066 ("bus: fsl-mc: add fsl-mc userspace support")
> > > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > 
> > Hi,
> > 
> > I just noticed that Greg wasn't copied on the initial email.
> > 
> > If you don't mind I will re-submit your patch along with other updates
> > to the fsl-mc bus so that you don't have to bother.
> > 
> 
> Thanks for doing that!
> 
> Was Greg supposed to have been copied, though?  He's not listed in the
> ./scripts/get_maintainer.pl output.
> 

Huh, he's not listed indeed. I didn't check this before since the fsl-mc
bus changes have always been pushed through Greg's char-misc tree.

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

end of thread, other threads:[~2021-02-08 18:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-01 12:28 [PATCH] bus: fsl-mc: Fix test for end of loop Dan Carpenter
2021-02-02 12:36 ` Ioana Ciornei
2021-02-08 14:18 ` Ioana Ciornei
2021-02-08 15:11   ` Dan Carpenter
2021-02-08 15:49     ` Ioana Ciornei

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