public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ioana Ciornei <ioana.ciornei@nxp.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Stuart Yoder <stuyoder@gmail.com>,
	Laurentiu Tudor <laurentiu.tudor@nxp.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kernel-janitors@vger.kernel.org"
	<kernel-janitors@vger.kernel.org>
Subject: Re: [PATCH] bus: fsl-mc: Fix test for end of loop
Date: Mon, 8 Feb 2021 14:18:04 +0000	[thread overview]
Message-ID: <20210208141803.bqbnbgvprtlo3vs6@skbuf> (raw)
In-Reply-To: <YBf0Br9obNGZTcNI@mwanda>

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
> 

  parent reply	other threads:[~2021-02-08 14:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2021-02-08 15:11   ` Dan Carpenter
2021-02-08 15:49     ` Ioana Ciornei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210208141803.bqbnbgvprtlo3vs6@skbuf \
    --to=ioana.ciornei@nxp.com \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=laurentiu.tudor@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stuyoder@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox