Browse Source

qcacmn: Validate len param to fix ASSERT

Fix to validate the length param before calling wmi_buf_alloc

Change-Id: Iec4551576135aa8c4ed1597a1360804d55fddf96
CRs-Fixed: 3134025
Vinod Kumar Myadam 3 năm trước cách đây
mục cha
commit
212a7a89b8
1 tập tin đã thay đổi với 4 bổ sung1 xóa
  1. 4 1
      wmi/src/wmi_unified.c

+ 4 - 1
wmi/src/wmi_unified.c

@@ -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)