[kbuild] drivers/net/ethernet/mscc/ocelot_vsc7514.c:554 ocelot_xtr_irq_handler() error: uninitialized symbol 'err'.

From: Dan Carpenter
Date: Fri Aug 27 2021 - 03:07:35 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 77dd11439b86e3f7990e4c0c9e0b67dca82750ba
commit: 924ee317f72459a49ac4130272c7d33063e60339 net: mscc: ocelot: refactor ocelot_xtr_irq_handler into ocelot_xtr_poll
config: openrisc-randconfig-m031-20210827 (attached as .config)
compiler: or1k-linux-gcc (GCC) 11.2.0

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

smatch warnings:
drivers/net/ethernet/mscc/ocelot_vsc7514.c:554 ocelot_xtr_irq_handler() error: uninitialized symbol 'err'.

vim +/err +554 drivers/net/ethernet/mscc/ocelot_vsc7514.c

a556c76adc052c drivers/net/ethernet/mscc/ocelot_board.c Alexandre Belloni 2018-05-14 534 static irqreturn_t ocelot_xtr_irq_handler(int irq, void *arg)
a556c76adc052c drivers/net/ethernet/mscc/ocelot_board.c Alexandre Belloni 2018-05-14 535 {
a556c76adc052c drivers/net/ethernet/mscc/ocelot_board.c Alexandre Belloni 2018-05-14 536 struct ocelot *ocelot = arg;
924ee317f72459 drivers/net/ethernet/mscc/ocelot_vsc7514.c Vladimir Oltean 2021-02-14 537 int grp = 0, err;
a556c76adc052c drivers/net/ethernet/mscc/ocelot_board.c Alexandre Belloni 2018-05-14 538
f833ca293dd121 drivers/net/ethernet/mscc/ocelot_vsc7514.c Vladimir Oltean 2021-02-14 539 while (ocelot_read(ocelot, QS_XTR_DATA_PRESENT) & BIT(grp)) {

Can this condition be false on the first iteration through the loop?

4e3b0468e6d7f3 drivers/net/ethernet/mscc/ocelot_board.c Antoine Tenart 2019-08-12 540 struct sk_buff *skb;
a556c76adc052c drivers/net/ethernet/mscc/ocelot_board.c Alexandre Belloni 2018-05-14 541
924ee317f72459 drivers/net/ethernet/mscc/ocelot_vsc7514.c Vladimir Oltean 2021-02-14 542 err = ocelot_xtr_poll_frame(ocelot, grp, &skb);
924ee317f72459 drivers/net/ethernet/mscc/ocelot_vsc7514.c Vladimir Oltean 2021-02-14 543 if (err)
a94306cea56fe4 drivers/net/ethernet/mscc/ocelot_vsc7514.c Vladimir Oltean 2021-02-14 544 goto out;
a94306cea56fe4 drivers/net/ethernet/mscc/ocelot_vsc7514.c Vladimir Oltean 2021-02-14 545
924ee317f72459 drivers/net/ethernet/mscc/ocelot_vsc7514.c Vladimir Oltean 2021-02-14 546 skb->dev->stats.rx_bytes += skb->len;
924ee317f72459 drivers/net/ethernet/mscc/ocelot_vsc7514.c Vladimir Oltean 2021-02-14 547 skb->dev->stats.rx_packets++;
a556c76adc052c drivers/net/ethernet/mscc/ocelot_board.c Alexandre Belloni 2018-05-14 548
b2e118f638fb89 drivers/net/ethernet/mscc/ocelot_board.c Antoine Tenart 2020-05-26 549 if (!skb_defer_rx_timestamp(skb))
a556c76adc052c drivers/net/ethernet/mscc/ocelot_board.c Alexandre Belloni 2018-05-14 550 netif_rx(skb);
f833ca293dd121 drivers/net/ethernet/mscc/ocelot_vsc7514.c Vladimir Oltean 2021-02-14 551 }
a556c76adc052c drivers/net/ethernet/mscc/ocelot_board.c Alexandre Belloni 2018-05-14 552
a94306cea56fe4 drivers/net/ethernet/mscc/ocelot_vsc7514.c Vladimir Oltean 2021-02-14 553 out:
d7795f8f26d944 drivers/net/ethernet/mscc/ocelot_vsc7514.c Vladimir Oltean 2021-02-14 @554 if (err < 0)
a556c76adc052c drivers/net/ethernet/mscc/ocelot_board.c Alexandre Belloni 2018-05-14 555 while (ocelot_read(ocelot, QS_XTR_DATA_PRESENT) & BIT(grp))
a556c76adc052c drivers/net/ethernet/mscc/ocelot_board.c Alexandre Belloni 2018-05-14 556 ocelot_read_rix(ocelot, QS_XTR_RD, grp);
a556c76adc052c drivers/net/ethernet/mscc/ocelot_board.c Alexandre Belloni 2018-05-14 557
a556c76adc052c drivers/net/ethernet/mscc/ocelot_board.c Alexandre Belloni 2018-05-14 558 return IRQ_HANDLED;
a556c76adc052c drivers/net/ethernet/mscc/ocelot_board.c Alexandre Belloni 2018-05-14 559 }

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

_______________________________________________
kbuild mailing list -- kbuild@xxxxxxxxxxxx
To unsubscribe send an email to kbuild-leave@xxxxxxxxxxxx