Re: [linux-next:master 10650/11475] drivers/net/can/janz-ican3.c:1303 ican3_get_echo_skb() error: uninitialized symbol 'dlc'.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon. 10 Jan 2022 at 15:49, Dan Carpenter <dan.carpenter@xxxxxxxxxx> wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   b8170452cd5121b11a5726e3ea8dbdfc2d74e771
> commit: cc4b08c31b5c51352f258032cc65e884b3e61e6a [10650/11475] can: do not increase tx_bytes statistics for RTR frames
> config: i386-randconfig-m021-20220107 (https://download.01.org/0day-ci/archive/20220108/202201081910.06vbmqbD-lkp@xxxxxxxxx/config)
> compiler: gcc-9 (Debian 9.3.0-22) 9.3.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>
>
> New smatch warnings:
> drivers/net/can/janz-ican3.c:1303 ican3_get_echo_skb() error: uninitialized symbol 'dlc'.
>
> vim +/dlc +1303 drivers/net/can/janz-ican3.c
>
> 83702f69272e45 Ira W. Snyder   2012-07-19  1284  static unsigned int ican3_get_echo_skb(struct ican3_dev *mod)
> 83702f69272e45 Ira W. Snyder   2012-07-19  1285  {
> 83702f69272e45 Ira W. Snyder   2012-07-19  1286         struct sk_buff *skb = skb_dequeue(&mod->echoq);
> 83702f69272e45 Ira W. Snyder   2012-07-19  1287         struct can_frame *cf;
> 83702f69272e45 Ira W. Snyder   2012-07-19  1288         u8 dlc;
> 83702f69272e45 Ira W. Snyder   2012-07-19  1289
> 83702f69272e45 Ira W. Snyder   2012-07-19  1290         /* this should never trigger unless there is a driver bug */
> 83702f69272e45 Ira W. Snyder   2012-07-19  1291         if (!skb) {
> 83702f69272e45 Ira W. Snyder   2012-07-19  1292                 netdev_err(mod->ndev, "BUG: echo skb not occupied\n");
> 83702f69272e45 Ira W. Snyder   2012-07-19  1293                 return 0;
> 83702f69272e45 Ira W. Snyder   2012-07-19  1294         }
> 83702f69272e45 Ira W. Snyder   2012-07-19  1295
> 83702f69272e45 Ira W. Snyder   2012-07-19  1296         cf = (struct can_frame *)skb->data;
> cc4b08c31b5c51 Vincent Mailhol 2021-12-07  1297         if (!(cf->can_id & CAN_RTR_FLAG))
> c7b74967799b1a Oliver Hartkopp 2020-11-20  1298                 dlc = cf->len;
>
> "dlc" not initialized on else path.
>
> 83702f69272e45 Ira W. Snyder   2012-07-19  1299
> 83702f69272e45 Ira W. Snyder   2012-07-19  1300         /* check flag whether this packet has to be looped back */
> 83702f69272e45 Ira W. Snyder   2012-07-19  1301         if (skb->pkt_type != PACKET_LOOPBACK) {
> 83702f69272e45 Ira W. Snyder   2012-07-19  1302                 kfree_skb(skb);
> 83702f69272e45 Ira W. Snyder   2012-07-19 @1303                 return dlc;
> 83702f69272e45 Ira W. Snyder   2012-07-19  1304         }
> 83702f69272e45 Ira W. Snyder   2012-07-19  1305
> 83702f69272e45 Ira W. Snyder   2012-07-19  1306         skb->protocol = htons(ETH_P_CAN);
> 83702f69272e45 Ira W. Snyder   2012-07-19  1307         skb->pkt_type = PACKET_BROADCAST;
> 83702f69272e45 Ira W. Snyder   2012-07-19  1308         skb->ip_summed = CHECKSUM_UNNECESSARY;
> 83702f69272e45 Ira W. Snyder   2012-07-19  1309         skb->dev = mod->ndev;
> 83702f69272e45 Ira W. Snyder   2012-07-19  1310         netif_receive_skb(skb);
> 83702f69272e45 Ira W. Snyder   2012-07-19  1311         return dlc;
> 83702f69272e45 Ira W. Snyder   2012-07-19  1312  }
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

This issue has already been fixed in net-next:
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=c579792562837ec2e64b006cfc9423e4177a4d26


Yours sincerely,
Vincent Mailhol




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux