From: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
To: David Binderman <dcb314@hotmail.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: linux-4.2-rc2/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:1993: possible bad error checking ?
Date: Tue, 14 Jul 2015 08:10:28 +0200 [thread overview]
Message-ID: <55A4A7D4.9000405@st.com> (raw)
In-Reply-To: <DUB128-W847EC851814161BB5A100A9C9C0@phx.gbl>
Hello David
thx to have looked at this. I'll check the code and eventually fix it,
unless you already have a patch to propose.
Kind Regards
Peppe
On 7/13/2015 11:48 AM, David Binderman wrote:
> Hello there,
>
> [linux-4.2-rc2/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:1993]: (style) Checking if unsigned variable 'entry' is less than zero.
>
> Source code is
>
> entry = priv->hw->mode->jumbo_frm(priv, skb, csum_insertion);
> if (unlikely(entry < 0))
> goto dma_map_err;
>
> but
>
> unsigned int entry;
>
> So the error checking from the function call looks broken to me.
>
> If the return value from the function call to jumbo_frm is a plain signed integer, suggest
> sanity check that *before* assigning into an unsigned integer.
>
> Regards
>
> David Binderman
>
>
>
prev parent reply other threads:[~2015-07-14 6:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-13 9:48 linux-4.2-rc2/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:1993: possible bad error checking ? David Binderman
2015-07-14 6:10 ` Giuseppe CAVALLARO [this message]
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=55A4A7D4.9000405@st.com \
--to=peppe.cavallaro@st.com \
--cc=dcb314@hotmail.com \
--cc=netdev@vger.kernel.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.