Procházet zdrojové kódy

qcacmn: fix null pointer 'err' reference issue

When 'err' is null pointer, QDF_ASSERT(0) will not return
directly, then null pointer reference will occur. To fix this
issue, return failure when 'err' is null pointer.

Change-Id: I5912571795ae55c6729ae06d5e06496598c21fbb
CRs-Fixed: 2642581
Rongjing Liao před 5 roky
rodič
revize
cff463564e
1 změnil soubory, kde provedl 4 přidání a 0 odebrání
  1. 4 0
      target_if/spectral/target_if_spectral.c

+ 4 - 0
target_if/spectral/target_if_spectral.c

@@ -2893,6 +2893,7 @@ _target_if_set_spectral_config(struct target_if_spectral *spectral,
 	if (!err) {
 		spectral_err("Error code argument is null");
 		QDF_ASSERT(0);
+		return QDF_STATUS_E_FAILURE;
 	}
 	*err = SPECTRAL_SCAN_ERR_INVALID;
 
@@ -3059,6 +3060,7 @@ target_if_set_spectral_config(struct wlan_objmgr_pdev *pdev,
 	if (!err) {
 		spectral_err("Error code argument is null");
 		QDF_ASSERT(0);
+		return QDF_STATUS_E_FAILURE;
 	}
 	*err = SPECTRAL_SCAN_ERR_INVALID;
 
@@ -3782,6 +3784,7 @@ target_if_start_spectral_scan(struct wlan_objmgr_pdev *pdev,
 	if (!err) {
 		spectral_err("Error code argument is null");
 		QDF_ASSERT(0);
+		return QDF_STATUS_E_FAILURE;
 	}
 	*err = SPECTRAL_SCAN_ERR_INVALID;
 
@@ -3951,6 +3954,7 @@ target_if_stop_spectral_scan(struct wlan_objmgr_pdev *pdev,
 	if (!err) {
 		spectral_err("Error code argument is null");
 		QDF_ASSERT(0);
+		return QDF_STATUS_E_FAILURE;
 	}
 	*err = SPECTRAL_SCAN_ERR_INVALID;