[linux-next:master 4136/7554] drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c:702:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false

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

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   9b992972fb9c2a1bc3fb25bab70da8a4385e3abe
commit: 5ff013914c62c493c206d70554cfb1d311ea481a [4136/7554] brcmfmac: firmware: Allow per-board firmware binaries
config: x86_64-randconfig-a004-20210813 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 62df4df41c939205b2dc0a2a3bfb75b8c1ed74fa)
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
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=5ff013914c62c493c206d70554cfb1d311ea481a
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout 5ff013914c62c493c206d70554cfb1d311ea481a
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

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

All warnings (new ones prefixed by >>):

>> drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c:702:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
           if (alt_path) {
               ^~~~~~~~
   drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c:709:6: note: uninitialized use occurs here
           if (ret) {
               ^~~
   drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c:702:2: note: remove the 'if' if its condition is always true
           if (alt_path) {
           ^~~~~~~~~~~~~~
   drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c:683:9: note: initialize the variable 'ret' to silence this warning
           int ret;
                  ^
                   = 0
   1 warning generated.


vim +702 drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c

   675	
   676	int brcmf_fw_get_firmwares(struct device *dev, struct brcmf_fw_request *req,
   677				   void (*fw_cb)(struct device *dev, int err,
   678						 struct brcmf_fw_request *req))
   679	{
   680		struct brcmf_fw_item *first = &req->items[0];
   681		struct brcmf_fw *fwctx;
   682		char *alt_path;
   683		int ret;
   684	
   685		brcmf_dbg(TRACE, "enter: dev=%s\n", dev_name(dev));
   686		if (!fw_cb)
   687			return -EINVAL;
   688	
   689		if (!brcmf_fw_request_is_valid(req))
   690			return -EINVAL;
   691	
   692		fwctx = kzalloc(sizeof(*fwctx), GFP_KERNEL);
   693		if (!fwctx)
   694			return -ENOMEM;
   695	
   696		fwctx->dev = dev;
   697		fwctx->req = req;
   698		fwctx->done = fw_cb;
   699	
   700		/* First try alternative board-specific path if any */
   701		alt_path = brcm_alt_fw_path(first->path, fwctx->req->board_type);
 > 702		if (alt_path) {
   703			ret = request_firmware_nowait(THIS_MODULE, true, alt_path,
   704						      fwctx->dev, GFP_KERNEL, fwctx,
   705						      brcmf_fw_request_done);
   706			kfree(alt_path);
   707		}
   708		/* Else try canonical path */
   709		if (ret) {
   710			ret = request_firmware_nowait(THIS_MODULE, true, first->path,
   711						      fwctx->dev, GFP_KERNEL, fwctx,
   712						      brcmf_fw_request_done);
   713		}
   714		if (ret < 0)
   715			brcmf_fw_request_done(NULL, fwctx);
   716	
   717		return 0;
   718	}
   719	

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

Attachment: .config.gz
Description: application/gzip


[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