public inbox for [email protected]
 help / color / mirror / Atom feed
From: kernel test robot <[email protected]>
To: Dan Carpenter <[email protected]>
Cc: [email protected], [email protected],
	Ammar Faizi <[email protected]>,
	GNU/Weeb Mailing List <[email protected]>,
	[email protected], Kalle Valo <[email protected]>
Subject: [ammarfaizi2-block:kvalo/ath/pending 3/9] drivers/net/wireless/ath/wil6210/debugfs.c:1030:9: warning: variable 'rc' is uninitialized when used here
Date: Mon, 25 Jul 2022 03:44:00 +0800	[thread overview]
Message-ID: <[email protected]> (raw)

tree:   https://github.com/ammarfaizi2/linux-block kvalo/ath/pending
head:   086f67ba21ede199307e78476353bda9ffef982c
commit: 7a4836560a6198d245d5732e26f94898b12eb760 [3/9] wifi: wil6210: debugfs: fix info leak in wil_write_file_wmi()
config: powerpc-randconfig-r002-20220718 (https://download.01.org/0day-ci/archive/20220725/[email protected]/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project d74b88c69dc2644bd0dc5d64e2d7413a0d4040e5)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install powerpc cross compiling tool for clang build
        # apt-get install binutils-powerpc-linux-gnu
        # https://github.com/ammarfaizi2/linux-block/commit/7a4836560a6198d245d5732e26f94898b12eb760
        git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
        git fetch --no-tags ammarfaizi2-block kvalo/ath/pending
        git checkout 7a4836560a6198d245d5732e26f94898b12eb760
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=powerpc SHELL=/bin/bash drivers/net/wireless/ath/wil6210/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <[email protected]>

All warnings (new ones prefixed by >>):

>> drivers/net/wireless/ath/wil6210/debugfs.c:1030:9: warning: variable 'rc' is uninitialized when used here [-Wuninitialized]
           return rc;
                  ^~
   drivers/net/wireless/ath/wil6210/debugfs.c:1013:8: note: initialize the variable 'rc' to silence this warning
           int rc, rc1;
                 ^
                  = 0
   1 warning generated.


vim +/rc +1030 drivers/net/wireless/ath/wil6210/debugfs.c

2be7d22f062535 Vladimir Kondratiev 2012-12-20  1000  
ff974e40833413 Vladimir Kondratiev 2014-06-16  1001  /* Write WMI command (w/o mbox header) to this file to send it
ff974e40833413 Vladimir Kondratiev 2014-06-16  1002   * WMI starts from wil6210_mbox_hdr_wmi header
ff974e40833413 Vladimir Kondratiev 2014-06-16  1003   */
ff974e40833413 Vladimir Kondratiev 2014-06-16  1004  static ssize_t wil_write_file_wmi(struct file *file, const char __user *buf,
ff974e40833413 Vladimir Kondratiev 2014-06-16  1005  				  size_t len, loff_t *ppos)
ff974e40833413 Vladimir Kondratiev 2014-06-16  1006  {
ff974e40833413 Vladimir Kondratiev 2014-06-16  1007  	struct wil6210_priv *wil = file->private_data;
e00243fab84b4e Lior David          2018-02-26  1008  	struct wil6210_vif *vif = ndev_to_vif(wil->main_ndev);
b874ddecae0a08 Lior David          2016-03-01  1009  	struct wmi_cmd_hdr *wmi;
ff974e40833413 Vladimir Kondratiev 2014-06-16  1010  	void *cmd;
b874ddecae0a08 Lior David          2016-03-01  1011  	int cmdlen = len - sizeof(struct wmi_cmd_hdr);
ff974e40833413 Vladimir Kondratiev 2014-06-16  1012  	u16 cmdid;
ff974e40833413 Vladimir Kondratiev 2014-06-16  1013  	int rc, rc1;
ff974e40833413 Vladimir Kondratiev 2014-06-16  1014  
7a4836560a6198 Dan Carpenter       2022-07-15  1015  	if (cmdlen < 0 || *ppos != 0)
ff974e40833413 Vladimir Kondratiev 2014-06-16  1016  		return -EINVAL;
ff974e40833413 Vladimir Kondratiev 2014-06-16  1017  
7a4836560a6198 Dan Carpenter       2022-07-15  1018  	wmi = memdup_user(buf, len);
7a4836560a6198 Dan Carpenter       2022-07-15  1019  	if (IS_ERR(wmi))
7a4836560a6198 Dan Carpenter       2022-07-15  1020  		return PTR_ERR(wmi);
ff974e40833413 Vladimir Kondratiev 2014-06-16  1021  
69218a48005d0c Lior David          2016-03-21  1022  	cmd = (cmdlen > 0) ? &wmi[1] : NULL;
b874ddecae0a08 Lior David          2016-03-01  1023  	cmdid = le16_to_cpu(wmi->command_id);
ff974e40833413 Vladimir Kondratiev 2014-06-16  1024  
e00243fab84b4e Lior David          2018-02-26  1025  	rc1 = wmi_send(wil, cmdid, vif->mid, cmd, cmdlen);
ff974e40833413 Vladimir Kondratiev 2014-06-16  1026  	kfree(wmi);
ff974e40833413 Vladimir Kondratiev 2014-06-16  1027  
af3db60a30331d Lazar Alexei        2017-01-20  1028  	wil_info(wil, "0x%04x[%d] -> %d\n", cmdid, cmdlen, rc1);
ff974e40833413 Vladimir Kondratiev 2014-06-16  1029  
ff974e40833413 Vladimir Kondratiev 2014-06-16 @1030  	return rc;
ff974e40833413 Vladimir Kondratiev 2014-06-16  1031  }
ff974e40833413 Vladimir Kondratiev 2014-06-16  1032  

:::::: The code at line 1030 was first introduced by commit
:::::: ff974e4083341383d3dd4079e52ed30f57f376f0 wil6210: debugfs interface to send raw WMI command

:::::: TO: Vladimir Kondratiev <[email protected]>
:::::: CC: John W. Linville <[email protected]>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

             reply	other threads:[~2022-07-24 19:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-24 19:44 kernel test robot [this message]
2022-07-24 20:26 ` [PATCH] wifi: wil6210: debugfs: fix uninitialized variable use in `wil_write_file_wmi()` Ammar Faizi
2022-07-25  6:34   ` Dan Carpenter
2022-07-27 10:20   ` Kalle Valo

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 \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /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