qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Nabih Estefan <nabihestefan@google.com>
Cc: peter.maydell@linaro.org,  qemu-devel@nongnu.org,
	 kfting@nuvoton.com, wuhaotsh@google.com,  jasowang@redhat.org
Subject: Re: [PATCH] hw/net: Fix Coverity Issue for npcm-gmac
Date: Wed, 19 Jun 2024 10:13:27 +0100	[thread overview]
Message-ID: <87o77xcn2g.fsf@draig.linaro.org> (raw)
In-Reply-To: <20240618172527.3450098-1-nabihestefan@google.com> (Nabih Estefan's message of "Tue, 18 Jun 2024 17:25:27 +0000")

Nabih Estefan <nabihestefan@google.com> writes:

> There is an extra `buf=` set that is not used by npcm-gmac. Remove it
> for coverity to be happy.

Have you go the coverity reference to include in the commit message?

>
> Signed-off-by: Nabih Estefan <nabihestefan@google.com>
> ---
>  hw/net/npcm_gmac.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/hw/net/npcm_gmac.c b/hw/net/npcm_gmac.c
> index 1b71e2526e..b397fd5064 100644
> --- a/hw/net/npcm_gmac.c
> +++ b/hw/net/npcm_gmac.c
> @@ -614,7 +614,6 @@ static void gmac_try_send_next_packet(NPCMGMACState *gmac)
>              net_checksum_calculate(tx_send_buffer, length, csum);
>              qemu_send_packet(qemu_get_queue(gmac->nic), tx_send_buffer, length);
>              trace_npcm_gmac_packet_sent(DEVICE(gmac)->canonical_path, length);
> -            buf = tx_send_buffer;

So coverity is saying that buf starts at tx_send_buffer and none of the
other legs that can mess with it are possible for the tx_desc.tdes1 &
TX_DESC_TDES1_LAST_SEG_MASK leg?

Or that buf should always start at tx_send_buffer and only ever advance
if we grow the size of the tx_send_buffer?


>              length = 0;
>          }

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro


  reply	other threads:[~2024-06-19  9:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-18 17:25 [PATCH] hw/net: Fix Coverity Issue for npcm-gmac Nabih Estefan
2024-06-19  9:13 ` Alex Bennée [this message]
2024-06-20  9:52   ` Peter Maydell
  -- strict thread matches above, loose matches on Subject: below --
2024-06-18 17:26 Nabih Estefan
2024-06-18 17:24 [PATCH] hw/net: Fix Coverity Issue for nocm-gmac Nabih Estefan
2024-06-18 17:24 ` [PATCH] hw/net: Fix Coverity Issue for npcm-gmac Nabih Estefan
2024-06-19  8:34   ` Zhang, Chen
2024-06-18 17:23 [PATCH] hw/net: Fix Coverity Issue for nocm-gmac Nabih Estefan
2024-06-18 17:23 ` [PATCH] hw/net: Fix Coverity Issue for npcm-gmac Nabih Estefan

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=87o77xcn2g.fsf@draig.linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=jasowang@redhat.org \
    --cc=kfting@nuvoton.com \
    --cc=nabihestefan@google.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=wuhaotsh@google.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;
as well as URLs for NNTP newsgroup(s).