ソースを参照

qcacld-3.0: Free the NAN buffer when fail to serialize the command

When same NAN commands are issued back to back, serialization
module rejects the commands when there is a command present
in the pending queue. But the memory allocated for the NAN buffer
is not freed in such failure cases.
Free the NAN buffer in such failure cases to avoid memleaks.

Change-Id: I1d1f9c077d4b6239f4400d9b3ed185e63e471b56
CRs-Fixed: 3341229
Srinivas Dasari 2 年 前
コミット
9d6fa2ef4d
1 ファイル変更2 行追加0 行削除
  1. 2 0
      components/nan/core/src/nan_main.c

+ 2 - 0
components/nan/core/src/nan_main.c

@@ -315,6 +315,8 @@ QDF_STATUS nan_scheduled_msg_handler(struct scheduler_msg *msg)
 	if (status != WLAN_SER_CMD_ACTIVE && status != WLAN_SER_CMD_PENDING) {
 		nan_err("unable to serialize command");
 		wlan_objmgr_vdev_release_ref(cmd.vdev, WLAN_NAN_ID);
+		qdf_mem_free(msg->bodyptr);
+		msg->bodyptr = NULL;
 		return QDF_STATUS_E_INVAL;
 	}
 	return QDF_STATUS_SUCCESS;