Re: [PATCH] e1000: check the return of pci_get_drvdata() in e1000_remove()
From: Stephen Hemminger
Date: Tue May 22 2018 - 20:53:18 EST
On Tue, 22 May 2018 17:17:43 -0700
Bo Chen <chenbo@xxxxxxx> 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@xxxxxxx>
Why check for something that can never be true.
You are creating dead code paths that can never be exercised.