qcacld-3.0: Null check while calling md_host_evt_cb
wma_motion_det_host_event_handler() get called when FW sent WMI_MOTION_DET_HOST_EVENTID message. After the initial processing, pmac->sme.md_host_evt_cb() is called to send the relevant data back up to the upper layers of WLAN. Since this callback function is dynamically registered there are cases where it might not be registered before this FW event is received, resulting in a NULL pointer dereference. Change-Id: I06b7907b39f4da0837196ccf377ecc2da325be8c CRs-Fixed: 2428803
This commit is contained in:

committed by
nshrivas

parent
e2b469f61f
commit
c67478f0d7
@@ -8018,6 +8018,11 @@ int wma_motion_det_host_event_handler(void *handle, uint8_t *event,
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!pmac || !pmac->sme.md_host_evt_cb) {
|
||||||
|
WMA_LOGE("Invalid motion detect callback");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
motion_det_event_hdr = param_buf->fixed_param;
|
motion_det_event_hdr = param_buf->fixed_param;
|
||||||
WMA_LOGA("motion detect host event received, vdev_id=%d, status=%d",
|
WMA_LOGA("motion detect host event received, vdev_id=%d, status=%d",
|
||||||
motion_det_event_hdr->vdev_id, motion_det_event_hdr->status);
|
motion_det_event_hdr->vdev_id, motion_det_event_hdr->status);
|
||||||
|
Reference in New Issue
Block a user