Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e77b8f69 authored by Dundi Raviteja's avatar Dundi Raviteja
Browse files

wlan: add check for wcts magic

Check for wcts magic before processing smd response.
Return if wcts magic is not valid.

Change-Id: If102cfdf7bd649405333e7332b202ff4c635d0dc
CRs-Fixed: 2771750
parent a2d010ad
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -495,6 +495,12 @@ int WCTS_smd_resp_process(struct rpmsg_device *rpdev,
	WCTS_ControlBlockType* wcts_cb = (WCTS_ControlBlockType*) priv;
	struct data_msg *msg;

	if (WCTS_CB_MAGIC != wcts_cb->wctsMagic) {
		WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
			   "%s: Received smd data in invalid state", __func__);
		return 0;
	}

	if (WCTS_STATE_REM_CLOSED == wcts_cb->wctsState) {
		WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
			"%s: received SMD data when wcts state is closed ",