From cff463564e1cbc99496f6c472670e91c5e7977b5 Mon Sep 17 00:00:00 2001 From: Rongjing Liao Date: Mon, 16 Mar 2020 21:47:43 +0800 Subject: [PATCH] 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 --- target_if/spectral/target_if_spectral.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target_if/spectral/target_if_spectral.c b/target_if/spectral/target_if_spectral.c index 590e96730db8..4f0b65707bce 100644 --- a/target_if/spectral/target_if_spectral.c +++ b/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;