All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH] e1000: check the return of pci_get_drvdata() in e1000_remove()
Date: Tue, 22 May 2018 18:47:02 -0700	[thread overview]
Message-ID: <20180522184702.64cd62f6@xeon-e3> (raw)
In-Reply-To: <20180523001743.8492-1-chenbo@pdx.edu>

On Tue, 22 May 2018 17:17:43 -0700
Bo Chen <chenbo@pdx.edu> wrote:

> This check on pci_get_drvdata() prevents potential invalid pointer dereferences,
> and is a common practice in *_remove() functions from other drivers, such as
> 'intel/e100.c', 'amd/pcnet32.c', 'realtek/8139too.c', and 'broadcom/tg3.c'.
> 
> Signed-off-by: Bo Chen <chenbo@pdx.edu>

Why check for something that can never be true.
You are creating dead code paths that can never be exercised.



WARNING: multiple messages have this Message-ID (diff)
From: Stephen Hemminger <stephen@networkplumber.org>
To: Bo Chen <chenbo@pdx.edu>
Cc: jeffrey.t.kirsher@intel.com, davem@davemloft.net,
	intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] e1000: check the return of pci_get_drvdata() in e1000_remove()
Date: Tue, 22 May 2018 18:47:02 -0700	[thread overview]
Message-ID: <20180522184702.64cd62f6@xeon-e3> (raw)
In-Reply-To: <20180523001743.8492-1-chenbo@pdx.edu>

On Tue, 22 May 2018 17:17:43 -0700
Bo Chen <chenbo@pdx.edu> wrote:

> This check on pci_get_drvdata() prevents potential invalid pointer dereferences,
> and is a common practice in *_remove() functions from other drivers, such as
> 'intel/e100.c', 'amd/pcnet32.c', 'realtek/8139too.c', and 'broadcom/tg3.c'.
> 
> Signed-off-by: Bo Chen <chenbo@pdx.edu>

Why check for something that can never be true.
You are creating dead code paths that can never be exercised.

  reply	other threads:[~2018-05-23  1:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-23  0:17 [PATCH] e1000: check the return of pci_get_drvdata() in e1000_remove() Bo Chen
2018-05-23  1:47 ` Stephen Hemminger [this message]
2018-05-23  1:47   ` Stephen Hemminger
2018-05-23  3:31   ` Bo Chen

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=20180522184702.64cd62f6@xeon-e3 \
    --to=stephen@networkplumber.org \
    --cc=intel-wired-lan@osuosl.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.