linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Sven Van Asbroeck <thesven73@gmail.com>
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>,
	kbuild-all@lists.01.org,
	Linux Memory Management List <linux-mm@kvack.org>,
	Jakub Kicinski <kuba@kernel.org>, Andrew Lunn <andrew@lunn.ch>
Subject: [linux-next:master 4603/5468] drivers/net/ethernet/microchip/lan743x_main.c:1049 lan743x_phy_open() error: uninitialized symbol 'phydev'.
Date: Fri, 13 Nov 2020 16:24:03 +0300	[thread overview]
Message-ID: <20201113132403.GN29398@kadam> (raw)

[-- Attachment #1: Type: text/plain, Size: 3538 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   a60b1e1fe9ca5f9d9a79e89a8d71228a8e04d35c
commit: 902a66e08ceaadb9a7a1ab3a4f3af611cd1d8cba [4603/5468] lan743x: correctly handle chips with internal PHY
config: x86_64-randconfig-m001-20201111 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/net/ethernet/microchip/lan743x_main.c:1049 lan743x_phy_open() error: uninitialized symbol 'phydev'.

vim +/phydev +1049 drivers/net/ethernet/microchip/lan743x_main.c

23f0703c125be49 Bryan Whitehead   2018-03-05  1019  static int lan743x_phy_open(struct lan743x_adapter *adapter)
23f0703c125be49 Bryan Whitehead   2018-03-05  1020  {
23f0703c125be49 Bryan Whitehead   2018-03-05  1021  	struct lan743x_phy *phy = &adapter->phy;
6f197fb63850b26 Roelof Berg       2020-05-29  1022  	struct device_node *phynode;
23f0703c125be49 Bryan Whitehead   2018-03-05  1023  	struct phy_device *phydev;
23f0703c125be49 Bryan Whitehead   2018-03-05  1024  	struct net_device *netdev;
23f0703c125be49 Bryan Whitehead   2018-03-05  1025  	int ret = -EIO;
23f0703c125be49 Bryan Whitehead   2018-03-05  1026  
23f0703c125be49 Bryan Whitehead   2018-03-05  1027  	netdev = adapter->netdev;
6f197fb63850b26 Roelof Berg       2020-05-29  1028  	phynode = of_node_get(adapter->pdev->dev.of_node);
6f197fb63850b26 Roelof Berg       2020-05-29  1029  
6f197fb63850b26 Roelof Berg       2020-05-29  1030  	if (phynode) {
902a66e08ceaadb Sven Van Asbroeck 2020-11-08  1031  		/* try devicetree phy, or fixed link */
6f197fb63850b26 Roelof Berg       2020-05-29  1032  		of_get_phy_mode(phynode, &adapter->phy_mode);
6f197fb63850b26 Roelof Berg       2020-05-29  1033  
6f197fb63850b26 Roelof Berg       2020-05-29  1034  		if (of_phy_is_fixed_link(phynode)) {
6f197fb63850b26 Roelof Berg       2020-05-29  1035  			ret = of_phy_register_fixed_link(phynode);
6f197fb63850b26 Roelof Berg       2020-05-29  1036  			if (ret) {
6f197fb63850b26 Roelof Berg       2020-05-29  1037  				netdev_err(netdev,
6f197fb63850b26 Roelof Berg       2020-05-29  1038  					   "cannot register fixed PHY\n");
6f197fb63850b26 Roelof Berg       2020-05-29  1039  				of_node_put(phynode);
6f197fb63850b26 Roelof Berg       2020-05-29  1040  				goto return_error;
6f197fb63850b26 Roelof Berg       2020-05-29  1041  			}
6f197fb63850b26 Roelof Berg       2020-05-29  1042  		}
6f197fb63850b26 Roelof Berg       2020-05-29  1043  		phydev = of_phy_connect(netdev, phynode,
6f197fb63850b26 Roelof Berg       2020-05-29  1044  					lan743x_phy_link_status_change, 0,
6f197fb63850b26 Roelof Berg       2020-05-29  1045  					adapter->phy_mode);
6f197fb63850b26 Roelof Berg       2020-05-29  1046  		of_node_put(phynode);
902a66e08ceaadb Sven Van Asbroeck 2020-11-08  1047  	}

Not initialized on else path.

902a66e08ceaadb Sven Van Asbroeck 2020-11-08  1048  
902a66e08ceaadb Sven Van Asbroeck 2020-11-08 @1049  	if (!phydev) {
                                                            ^^^^^^^

902a66e08ceaadb Sven Van Asbroeck 2020-11-08  1050  		/* try internal phy */
23f0703c125be49 Bryan Whitehead   2018-03-05  1051  		phydev = phy_find_first(adapter->mdiobus);
23f0703c125be49 Bryan Whitehead   2018-03-05  1052  		if (!phydev)

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 35307 bytes --]

             reply	other threads:[~2020-11-13 13:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-13 13:24 Dan Carpenter [this message]
2020-11-13 15:28 ` Jakub Kicinski

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=20201113132403.GN29398@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=andrew@lunn.ch \
    --cc=error27@gmail.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kbuild@lists.01.org \
    --cc=kuba@kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=thesven73@gmail.com \
    /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