netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Fastabend <john.r.fastabend@intel.com>
To: Dan Carpenter <dan.carpenter@oracle.com>,
	"Kirsher, Jeffrey T" <jeffrey.t.kirsher@intel.com>
Cc: "e1000-devel@lists.sourceforge.net"
	<e1000-devel@lists.sourceforge.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: ixgbe: fixup hard dependencies on supporting 8 traffic classes
Date: Tue, 11 Oct 2011 23:58:33 -0700	[thread overview]
Message-ID: <4E953A99.4030402@intel.com> (raw)
In-Reply-To: <20111012063555.GA23359@elgon.mountain>

On 10/11/2011 11:35 PM, Dan Carpenter wrote:
> Hello John Fastabend,
> 
> This is a semi-automatic email about new static checker warnings.
> 
> The patch 32701dc2e616: "ixgbe: fixup hard dependencies on supporting
> 8 traffic classes" from Sep 27, 2011, leads to the following Smatch
> complaint:
> 
> drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +3366 ixgbe_configure_dcb()
> 	 error: we previously assumed 'adapter->ixgbe_ieee_ets' could be null (see line 3357)
> 
> drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
>   3356	
>   3357			if (adapter->ixgbe_ieee_ets) {
>                             ^^^^^^^^^^^^^^^^^^^^^^^
> Null check.
> 
>   3358				struct ieee_ets *ets = adapter->ixgbe_ieee_ets;
>   3359				int max_frame = dev->mtu + ETH_HLEN + ETH_FCS_LEN;
>   3360	
>   3361				ixgbe_dcb_hw_ets(&adapter->hw, ets, max_frame);
>   3362			}
>   3363	
>   3364			if (adapter->ixgbe_ieee_pfc) {
>   3365				struct ieee_pfc *pfc = adapter->ixgbe_ieee_pfc;
>   3366				u8 *prio_tc = adapter->ixgbe_ieee_ets->prio_tc;
>                                               ^^^^^^^^^^^^^^^^^^^^^^^^^
> New dereference.
> 
>   3367	
>   3368				ixgbe_dcb_hw_pfc_config(&adapter->hw, pfc->pfc_en,
> 
> regards,
> dan carpenter
> 

Actually both structures ixgbe_ieee_ets and ixgbe_ieee_pfc get initialized
at the same time. So no null dereference will occur. That said this snippit
should be fixed.

I'll send a patch to JeffK. Thanks for the catch Dan.

.John

      reply	other threads:[~2011-10-12  6:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-12  6:35 ixgbe: fixup hard dependencies on supporting 8 traffic classes Dan Carpenter
2011-10-12  6:58 ` John Fastabend [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=4E953A99.4030402@intel.com \
    --to=john.r.fastabend@intel.com \
    --cc=dan.carpenter@oracle.com \
    --cc=e1000-devel@lists.sourceforge.net \
    --cc=jeffrey.t.kirsher@intel.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 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).