From: kernel test robot <lkp@intel.com>
To: Defang Bo <bodefang@126.com>,
siva.kallam@broadcom.com, prashant@broadcom.com,
mchan@broadcom.com, davem@davemloft.net, kuba@kernel.org
Cc: kbuild-all@lists.01.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, Defang Bo <bodefang@126.com>
Subject: Re: [PATCH] tg3: Avoid NULL pointer dereference in netif_device_attach()
Date: Mon, 19 Oct 2020 21:51:22 +0800 [thread overview]
Message-ID: <202010192103.5KoXOuvZ-lkp@intel.com> (raw)
In-Reply-To: <1603106567-4589-1-git-send-email-bodefang@126.com>
[-- Attachment #1: Type: text/plain, Size: 2910 bytes --]
Hi Defang,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on v5.9 next-20201016]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Defang-Bo/tg3-Avoid-NULL-pointer-dereference-in-netif_device_attach/20201019-195653
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 7cf726a59435301046250c42131554d9ccc566b8
config: x86_64-randconfig-s022-20201019 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-dirty
# https://github.com/0day-ci/linux/commit/3f835547ea4fb78c40a11c129412f724994829fe
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Defang-Bo/tg3-Avoid-NULL-pointer-dereference-in-netif_device_attach/20201019-195653
git checkout 3f835547ea4fb78c40a11c129412f724994829fe
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
drivers/net/ethernet/broadcom/tg3.c: In function 'tg3_resume':
>> drivers/net/ethernet/broadcom/tg3.c:18111:7: error: 'netdev' undeclared (first use in this function); did you mean 'net_eq'?
18111 | if (!netdev || !netif_running(dev))
| ^~~~~~
| net_eq
drivers/net/ethernet/broadcom/tg3.c:18111:7: note: each undeclared identifier is reported only once for each function it appears in
vim +18111 drivers/net/ethernet/broadcom/tg3.c
18102
18103 static int tg3_resume(struct device *device)
18104 {
18105 struct net_device *dev = dev_get_drvdata(device);
18106 struct tg3 *tp = netdev_priv(dev);
18107 int err = 0;
18108
18109 rtnl_lock();
18110
18111 if (!netdev || !netif_running(dev))
18112 goto unlock;
18113
18114 netif_device_attach(dev);
18115
18116 tg3_full_lock(tp, 0);
18117
18118 tg3_ape_driver_state_change(tp, RESET_KIND_INIT);
18119
18120 tg3_flag_set(tp, INIT_COMPLETE);
18121 err = tg3_restart_hw(tp,
18122 !(tp->phy_flags & TG3_PHYFLG_KEEP_LINK_ON_PWRDN));
18123 if (err)
18124 goto out;
18125
18126 tg3_timer_start(tp);
18127
18128 tg3_netif_start(tp);
18129
18130 out:
18131 tg3_full_unlock(tp);
18132
18133 if (!err)
18134 tg3_phy_start(tp);
18135
18136 unlock:
18137 rtnl_unlock();
18138 return err;
18139 }
18140 #endif /* CONFIG_PM_SLEEP */
18141
---
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: 40464 bytes --]
prev parent reply other threads:[~2020-10-19 13:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-19 11:22 [PATCH] tg3: Avoid NULL pointer dereference in netif_device_attach() Defang Bo
2020-10-19 13:51 ` kernel test robot [this message]
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=202010192103.5KoXOuvZ-lkp@intel.com \
--to=lkp@intel.com \
--cc=bodefang@126.com \
--cc=davem@davemloft.net \
--cc=kbuild-all@lists.01.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=prashant@broadcom.com \
--cc=siva.kallam@broadcom.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;
as well as URLs for NNTP newsgroup(s).