qcacmn: Add null pointer check

Add null pointer check for wmi handle in CFR functions.

CRs-Fixed: 2673593
Change-Id: I0993f36749f856df8849913f0338a8dc2581fa95
This commit is contained in:
Vikram Kandukuri 2020-05-15 00:44:36 +05:30 • committed by nshrivas
commit b94338a8d7

View file

@ -49,6 +49,10 @@ int target_if_cfr_stop_capture(struct wlan_objmgr_pdev *pdev,
return -EINVAL;
pdev_wmi_handle = lmac_get_pdev_wmi_handle(pdev);
if (!pdev_wmi_handle) {
cfr_err("pdev wmi handle NULL");
return -EINVAL;
}
vdev = wlan_peer_get_vdev(peer);
qdf_mem_set(&param, sizeof(param), 0);
@ -92,6 +96,10 @@ int target_if_cfr_start_capture(struct wlan_objmgr_pdev *pdev,
int retv = 0;
pdev_wmi_handle = lmac_get_pdev_wmi_handle(pdev);
if (!pdev_wmi_handle) {
cfr_err("pdev wmi handle NULL");
return -EINVAL;
}
vdev = wlan_peer_get_vdev(peer);
qdf_mem_set(&param, sizeof(param), 0);
@ -112,16 +120,22 @@ int target_if_cfr_pdev_set_param(struct wlan_objmgr_pdev *pdev,
{
struct pdev_params pparam;
uint32_t pdev_id;
struct wmi_unified *pdev_wmi_handle = NULL;
pdev_id = wlan_objmgr_pdev_get_pdev_id(pdev);
if (pdev_id < 0)
return -EINVAL;
pdev_wmi_handle = lmac_get_pdev_wmi_handle(pdev);
if (!pdev_wmi_handle) {
cfr_err("pdev wmi handle NULL");
return -EINVAL;
}
qdf_mem_set(&pparam, sizeof(pparam), 0);
pparam.param_id = param_id;
pparam.param_value = param_value;
return wmi_unified_pdev_param_send(lmac_get_pdev_wmi_handle(pdev),
return wmi_unified_pdev_param_send(pdev_wmi_handle,
&pparam, pdev_id);
}