Search Linux Wireless

[bug report] wifi: iwlwifi: mvm: add start mac ctdp sum calculation debugfs handler

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

 



Hello iallouch,

The patch 706f1b5d83ca: "wifi: iwlwifi: mvm: add start mac ctdp sum
calculation debugfs handler" from Oct 4, 2023 (linux-next), leads to
the following Smatch static checker warning:

	drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c:64 iwl_dbgfs_stop_ctdp_write()
	error: uninitialized symbol 'force'.

drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
    49 static ssize_t iwl_dbgfs_stop_ctdp_write(struct iwl_mvm *mvm, char *buf,
    50                                          size_t count, loff_t *ppos)
    51 {
    52         int ret;
    53         bool force;
    54 
    55         if (!kstrtobool(buf, &force))
    56                 IWL_DEBUG_INFO(mvm,
    57                                "force start is %d [0=disabled, 1=enabled]\n",
    58                                force);

If kstrtobool() fails then force is uninitialized.  This should be:

	ret = kstrtobool(buf, &force);
	if (ret)
		return ret;

I feel like the IWL_DEBUG_INFO() does not add anything and should be
deleted.  Right now it's printing on the success path...

    59 
    60         /* we allow skipping cap support check and force stop ctdp
    61          * statistics collection and with guerantee that it is
    62          * safe to use.
    63          */
--> 64         if (!force && !iwl_mvm_is_ctdp_supported(mvm))
    65                 return -EOPNOTSUPP;
    66 
    67         if (!iwl_mvm_firmware_running(mvm) ||
    68             mvm->fwrt.cur_fw_img != IWL_UCODE_REGULAR)
    69                 return -EIO;
    70 
    71         mutex_lock(&mvm->mutex);
    72         ret = iwl_mvm_ctdp_command(mvm, CTDP_CMD_OPERATION_STOP, 0);
    73         mutex_unlock(&mvm->mutex);
    74 
    75         return ret ?: count;
    76 }

regards,
dan carpenter



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux