All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vincent MAILHOL <mailhol.vincent@wanadoo.fr>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: kbuild@lists.01.org, lkp@intel.com, kbuild-all@lists.01.org,
	 Linux Memory Management List <linux-mm@kvack.org>,
	Marc Kleine-Budde <mkl@pengutronix.de>, Tom Rix <trix@redhat.com>
Subject: Re: [linux-next:master 10650/11475] drivers/net/can/janz-ican3.c:1303 ican3_get_echo_skb() error: uninitialized symbol 'dlc'.
Date: Mon, 10 Jan 2022 16:09:30 +0900	[thread overview]
Message-ID: <CAMZ6RqKX6dJ3wGJFaRerd4=XixtWMPRmMHqzvQaooTX7beu-6w@mail.gmail.com> (raw)
In-Reply-To: <202201081910.06vbmqbD-lkp@intel.com>

On Mon. 10 Jan 2022 at 15:49, Dan Carpenter <dan.carpenter@oracle.com> 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@intel.com/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@intel.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> 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@lists.01.org

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


WARNING: multiple messages have this Message-ID (diff)
From: Vincent MAILHOL <mailhol.vincent@wanadoo.fr>
To: kbuild-all@lists.01.org
Subject: Re: [linux-next:master 10650/11475] drivers/net/can/janz-ican3.c:1303 ican3_get_echo_skb() error: uninitialized symbol 'dlc'.
Date: Mon, 10 Jan 2022 16:09:30 +0900	[thread overview]
Message-ID: <CAMZ6RqKX6dJ3wGJFaRerd4=XixtWMPRmMHqzvQaooTX7beu-6w@mail.gmail.com> (raw)
In-Reply-To: <202201081910.06vbmqbD-lkp@intel.com>

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

On Mon. 10 Jan 2022 at 15:49, Dan Carpenter <dan.carpenter@oracle.com> 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(a)intel.com/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@intel.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> 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(a)lists.01.org

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

  reply	other threads:[~2022-01-10  7:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-08 12:05 [linux-next:master 10650/11475] drivers/net/can/janz-ican3.c:1303 ican3_get_echo_skb() error: uninitialized symbol 'dlc' kernel test robot
2022-01-10  6:49 ` Dan Carpenter
2022-01-10  7:09 ` Vincent MAILHOL [this message]
2022-01-10  7:09   ` Vincent MAILHOL
2022-01-08 17:42 kernel test robot

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='CAMZ6RqKX6dJ3wGJFaRerd4=XixtWMPRmMHqzvQaooTX7beu-6w@mail.gmail.com' \
    --to=mailhol.vincent@wanadoo.fr \
    --cc=dan.carpenter@oracle.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kbuild@lists.01.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=mkl@pengutronix.de \
    --cc=trix@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.