qcacmn: Validate len param to fix ASSERT

Fix to validate the length param before calling wmi_buf_alloc

Change-Id: Iec4551576135aa8c4ed1597a1360804d55fddf96
CRs-Fixed: 3134025
This commit is contained in:
Vinod Kumar Myadam
2022-03-04 11:03:48 +05:30
committed by Madan Koyyalamudi
parent 3f4d0fccaa
commit 212a7a89b8

View File

@@ -2703,8 +2703,11 @@ static int __wmi_process_qmi_fw_event(void *wmi_cb_ctx, void *buf, int len)
wmi_buf_t evt_buf;
uint32_t evt_id;
if (!wmi_handle || !buf)
if (!wmi_handle || !buf || !len) {
wmi_err_rl("%s is invalid", !wmi_handle ?
"wmi_buf" : !buf ? "buf" : "length");
return -EINVAL;
}
evt_buf = wmi_buf_alloc(wmi_handle, len);
if (!evt_buf)