All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org, qemu-trivial@nongnu.org, patches@linaro.org
Subject: Re: [Qemu-trivial] [PATCH] disas/cris.c: Fix Coverity warning about unchecked NULL
Date: Mon, 9 Jan 2017 21:13:54 +0100	[thread overview]
Message-ID: <20170109201354.GV9606@toto> (raw)
In-Reply-To: <1483988759-14606-1-git-send-email-peter.maydell@linaro.org>

On Mon, Jan 09, 2017 at 07:05:59PM +0000, Peter Maydell wrote:
> Coverity (CID 1005689) warns that we don't check that
> spec_reg_info() returned non-NULL before dereferencing.
> Add the check, though as the comment notes this is
> a can't-really-happen case because the earlier constraint
> matching should have ruled out the "unknown reg" case.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>


> ---
>  disas/cris.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/disas/cris.c b/disas/cris.c
> index 08161d1..8a1daf9 100644
> --- a/disas/cris.c
> +++ b/disas/cris.c
> @@ -2490,7 +2490,7 @@ print_with_operands (const struct cris_opcode *opcodep,
>  	const struct cris_spec_reg *sregp
>  	  = spec_reg_info ((insn >> 12) & 15, disdata->distype);
>  
> -	if (sregp->name == NULL)
> +	if (sregp == NULL || sregp->name == NULL)
>  	  /* Should have been caught as a non-match earlier.  */
>  	  *tp++ = '?';
>  	else
> -- 
> 2.7.4
> 


WARNING: multiple messages have this Message-ID (diff)
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org, qemu-trivial@nongnu.org, patches@linaro.org
Subject: Re: [Qemu-devel] [PATCH] disas/cris.c: Fix Coverity warning about unchecked NULL
Date: Mon, 9 Jan 2017 21:13:54 +0100	[thread overview]
Message-ID: <20170109201354.GV9606@toto> (raw)
In-Reply-To: <1483988759-14606-1-git-send-email-peter.maydell@linaro.org>

On Mon, Jan 09, 2017 at 07:05:59PM +0000, Peter Maydell wrote:
> Coverity (CID 1005689) warns that we don't check that
> spec_reg_info() returned non-NULL before dereferencing.
> Add the check, though as the comment notes this is
> a can't-really-happen case because the earlier constraint
> matching should have ruled out the "unknown reg" case.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>


> ---
>  disas/cris.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/disas/cris.c b/disas/cris.c
> index 08161d1..8a1daf9 100644
> --- a/disas/cris.c
> +++ b/disas/cris.c
> @@ -2490,7 +2490,7 @@ print_with_operands (const struct cris_opcode *opcodep,
>  	const struct cris_spec_reg *sregp
>  	  = spec_reg_info ((insn >> 12) & 15, disdata->distype);
>  
> -	if (sregp->name == NULL)
> +	if (sregp == NULL || sregp->name == NULL)
>  	  /* Should have been caught as a non-match earlier.  */
>  	  *tp++ = '?';
>  	else
> -- 
> 2.7.4
> 

  parent reply	other threads:[~2017-01-09 20:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-09 19:05 [Qemu-trivial] [PATCH] disas/cris.c: Fix Coverity warning about unchecked NULL Peter Maydell
2017-01-09 19:05 ` [Qemu-devel] " Peter Maydell
2017-01-09 19:10 ` [Qemu-trivial] " no-reply
2017-01-09 19:10   ` no-reply
2017-01-09 21:35   ` [Qemu-trivial] " Peter Maydell
2017-01-09 21:35     ` Peter Maydell
2017-01-09 22:20     ` [Qemu-trivial] " Edgar E. Iglesias
2017-01-09 22:20       ` Edgar E. Iglesias
2017-01-09 20:13 ` Edgar E. Iglesias [this message]
2017-01-09 20:13   ` Edgar E. Iglesias
2017-01-12 11:03 ` [Qemu-trivial] " Michael Tokarev
2017-01-12 11:03   ` [Qemu-devel] " Michael Tokarev

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=20170109201354.GV9606@toto \
    --to=edgar.iglesias@gmail.com \
    --cc=patches@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.