public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: [bug report] net: fec: add phy_reset_after_clk_enable() support
Date: Tue, 13 Mar 2018 12:44:33 +0000	[thread overview]
Message-ID: <20180313124415.GA16682@mwanda> (raw)

Hello Richard Leitner,

This is a semi-automatic email about new static checker warnings.

The patch 1b0a83ac04e3: "net: fec: add phy_reset_after_clk_enable() 
support" from Dec 11, 2017, leads to the following Smatch complaint:

    drivers/net/ethernet/freescale/fec_main.c:2895 fec_enet_open()
    error: we previously assumed 'ndev->phydev' could be null (see line 2864)

drivers/net/ethernet/freescale/fec_main.c
  2863		 */
  2864		if (ndev->phydev && ndev->phydev->drv)
                    ^^^^^^^^^^^^
Patch introduced a new check.

  2865			reset_again = false;
  2866		else
  2867			reset_again = true;
  2868	
  2869		/* I should reset the ring buffers here, but I don't yet know
  2870		 * a simple way to do that.
  2871		 */
  2872	
  2873		ret = fec_enet_alloc_buffers(ndev);
  2874		if (ret)
  2875			goto err_enet_alloc;
  2876	
  2877		/* Init MAC prior to mii bus probe */
  2878		fec_restart(ndev);
  2879	
  2880		/* Probe and connect to PHY when open the interface */
  2881		ret = fec_enet_mii_probe(ndev);
  2882		if (ret)
  2883			goto err_enet_mii_probe;
  2884	
  2885		/* Call phy_reset_after_clk_enable() again if it failed during
  2886		 * phy_reset_after_clk_enable() before because the PHY wasn't probed.
  2887		 */
  2888		if (reset_again)
  2889			phy_reset_after_clk_enable(ndev->phydev);
  2890	
  2891		if (fep->quirks & FEC_QUIRK_ERR006687)
  2892			imx6q_cpuidle_fec_irqs_used();
  2893	
  2894		napi_enable(&fep->napi);
  2895		phy_start(ndev->phydev);
                          ^^^^^^^^^^^^
Unchecked dereference inside function.

  2896		netif_tx_start_all_queues(ndev);
  2897	

regards,
dan carpenter

             reply	other threads:[~2018-03-13 12:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-13 12:44 Dan Carpenter [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-06-27 13:29 [bug report] net: fec: add phy_reset_after_clk_enable() support Dan Carpenter

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=20180313124415.GA16682@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=kernel-janitors@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