[ath:ath12k-mlo-qcn9274 22/81] drivers/net/wireless/ath/ath12k/mac.c:9400 ath12k_mac_destroy() error: we previously assumed 'ab' could be null (see line 9389)

Dan Carpenter dan.carpenter at linaro.org
Tue Oct 8 05:58:16 PDT 2024


tree:   https://git.kernel.org/pub/scm/linux/kernel/git/ath/ath.git ath12k-mlo-qcn9274
head:   4ad14f50820745f9c2f425ba07ca8431bf2409ed
commit: 6c252823bedb7f8f34d53dddadd65761f85bd3c4 [22/81] wifi: ath12k: move ath12k_hw from per device to group
config: csky-randconfig-r072-20241008 (https://download.01.org/0day-ci/archive/20241008/202410081858.ShABiCCT-lkp@intel.com/config)
compiler: csky-linux-gcc (GCC) 14.1.0

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp at intel.com>
| Reported-by: Dan Carpenter <dan.carpenter at linaro.org>
| Closes: https://lore.kernel.org/r/202410081858.ShABiCCT-lkp@intel.com/

New smatch warnings:
drivers/net/wireless/ath/ath12k/mac.c:9400 ath12k_mac_destroy() error: we previously assumed 'ab' could be null (see line 9389)

vim +/ab +9400 drivers/net/wireless/ath/ath12k/mac.c

6c252823bedb7f Karthikeyan Periyasamy 2024-04-12  9380  void ath12k_mac_destroy(struct ath12k_hw_group *ag)
8a742a79f90e3d Karthikeyan Periyasamy 2024-01-14  9381  {
6db6e70a17f6fb Karthikeyan Periyasamy 2024-01-18  9382  	struct ath12k_pdev *pdev;
6c252823bedb7f Karthikeyan Periyasamy 2024-04-12  9383  	struct ath12k_base *ab = ag->ab[0];
6c252823bedb7f Karthikeyan Periyasamy 2024-04-12  9384  	int i, j;
01f062770f9740 Karthikeyan Periyasamy 2024-04-12  9385  	struct ath12k_hw *ah;
6db6e70a17f6fb Karthikeyan Periyasamy 2024-01-18  9386  
6c252823bedb7f Karthikeyan Periyasamy 2024-04-12  9387  	for (i = 0; i < ag->num_devices; i++) {
6c252823bedb7f Karthikeyan Periyasamy 2024-04-12  9388  		ab = ag->ab[i];
6c252823bedb7f Karthikeyan Periyasamy 2024-04-12 @9389  		if (!ab)
                                                                             ^^
ab can be NULL

6db6e70a17f6fb Karthikeyan Periyasamy 2024-01-18  9390  			continue;
6db6e70a17f6fb Karthikeyan Periyasamy 2024-01-18  9391  
6c252823bedb7f Karthikeyan Periyasamy 2024-04-12  9392  		for (j = 0; j < ab->num_radios; j++) {
6c252823bedb7f Karthikeyan Periyasamy 2024-04-12  9393  			pdev = &ab->pdevs[j];
6c252823bedb7f Karthikeyan Periyasamy 2024-04-12  9394  			if (!pdev->ar)
6c252823bedb7f Karthikeyan Periyasamy 2024-04-12  9395  				continue;
6db6e70a17f6fb Karthikeyan Periyasamy 2024-01-18  9396  			pdev->ar = NULL;
6db6e70a17f6fb Karthikeyan Periyasamy 2024-01-18  9397  		}
6c252823bedb7f Karthikeyan Periyasamy 2024-04-12  9398  	}
6db6e70a17f6fb Karthikeyan Periyasamy 2024-01-18  9399  
e46d266981a601 Karthikeyan Periyasamy 2024-04-12 @9400  	for (i = 0; i < ath12k_get_num_hw(ab); i++) {
                                                                                                  ^^
Dereferenced inside function

01f062770f9740 Karthikeyan Periyasamy 2024-04-12  9401  		ah = ath12k_ab_to_ah(ab, i);
01f062770f9740 Karthikeyan Periyasamy 2024-04-12  9402  		if (!ah)
6db6e70a17f6fb Karthikeyan Periyasamy 2024-01-18  9403  			continue;
6db6e70a17f6fb Karthikeyan Periyasamy 2024-01-18  9404  
01f062770f9740 Karthikeyan Periyasamy 2024-04-12  9405  		ath12k_mac_hw_destroy(ah);
01f062770f9740 Karthikeyan Periyasamy 2024-04-12  9406  		ath12k_ab_set_ah(ab, i, NULL);
6db6e70a17f6fb Karthikeyan Periyasamy 2024-01-18  9407  	}
8a742a79f90e3d Karthikeyan Periyasamy 2024-01-14  9408  }

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




More information about the ath12k mailing list