From: antoine.tenart@free-electrons.com (Antoine Tenart)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH net-next 6/8] net: ethernet: annapurna: add wol helpers to the Alpine driver
Date: Fri, 10 Feb 2017 11:12:47 +0100 [thread overview]
Message-ID: <20170210101247.pxie2wtkbgh4th7f@kwain> (raw)
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6DB027C6C3@AcuExch.aculab.com>
Hi!
On Mon, Feb 06, 2017 at 11:35:49AM +0000, David Laight wrote:
> From: netdev-owner at vger.kernel.org [mailto:netdev-owner at vger.kernel.org] On Behalf Of Sergei Shtylyov
> > Sent: 03 February 2017 18:22
> > On 02/03/2017 09:12 PM, Antoine Tenart wrote:
> >
> > > + if ((adapter) && (adapter->phy_exist) && (adapter->mdio_bus)) {
> >
> > Now that's somewhat stupid looking... does the whole driver use this "style"?
>
> Not only that, in one of the two functions it is followed by:
>
> + device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
>
> Which assumes that 'adapter' is not NULL.
> Some verifiers will detect that as a possible NULL pointer dereference.
>
> Pointers should only be checked for NULL if there are valid reasons
> why they can be NULL in that code path.
> Getting there with a NULL pointer dues to some race condition isn't one of them.
Totally agree, for the NULL checks and for the useless parenthesis. I'll
try to catch other examples of this in the driver.
Thanks!
Antoine
--
Antoine T?nart, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170210/dc32ea36/attachment.sig>
next prev parent reply other threads:[~2017-02-10 10:12 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-03 18:12 [PATCH net-next 0/8] ARM: Alpine: Ethernet support Antoine Tenart
2017-02-03 18:12 ` [PATCH net-next 1/8] alpine: add I/O fabric interrupt controller (iofic) helpers Antoine Tenart
2017-02-03 18:12 ` [PATCH net-next 2/8] soc: alpine: add udma helpers Antoine Tenart
2017-02-03 18:12 ` [PATCH net-next 3/8] pci: add Annapurna Labs PCI id Antoine Tenart
2017-02-03 18:12 ` [PATCH net-next 5/8] net: ethernet: annapurna: add statistics helper Antoine Tenart
2017-02-03 19:34 ` Florian Fainelli
2017-02-03 21:24 ` kbuild test robot
2017-02-03 18:12 ` [PATCH net-next 6/8] net: ethernet: annapurna: add wol helpers to the Alpine driver Antoine Tenart
2017-02-03 18:21 ` Sergei Shtylyov
2017-02-06 11:35 ` David Laight
2017-02-06 12:02 ` Sergei Shtylyov
2017-02-10 10:12 ` Antoine Tenart [this message]
2017-02-03 18:12 ` [PATCH net-next 7/8] net: ethernet: annapurna: add eee " Antoine Tenart
2017-02-03 19:01 ` Florian Fainelli
2017-02-03 18:12 ` [PATCH net-next 8/8] net: ethernet: annapurna: add the coalesce " Antoine Tenart
[not found] ` <20170203181216.30214-5-antoine.tenart@free-electrons.com>
2017-02-03 20:58 ` [PATCH net-next 4/8] net: ethernet: add the Alpine Ethernet driver Andrew Lunn
2017-08-07 7:39 ` Chocron, Jonathan
2017-08-27 13:47 ` Chocron, Jonathan
2017-08-28 18:09 ` Andrew Lunn
2017-11-02 16:05 ` Chocron, Jonathan
2017-11-02 18:19 ` Florian Fainelli
2017-11-05 12:29 ` BSHARA, Said
2017-11-05 15:22 ` Andrew Lunn
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=20170210101247.pxie2wtkbgh4th7f@kwain \
--to=antoine.tenart@free-electrons.com \
--cc=linux-arm-kernel@lists.infradead.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