Browse Source

Merge "msm: ipa3: Fix to NULL terminate the header pointer in proc header table"

qctecmdr 3 years ago
parent
commit
9ba1c31180
1 changed files with 3 additions and 0 deletions
  1. 3 0
      drivers/platform/msm/ipa/ipa_v3/ipa_hdr.c

+ 3 - 0
drivers/platform/msm/ipa/ipa_v3/ipa_hdr.c

@@ -1270,6 +1270,7 @@ int ipa3_reset_hdr(bool user_only)
 
 			if (ipa3_id_find(entry->id) == NULL) {
 				mutex_unlock(&ipa3_ctx->lock);
+				IPAERR_RL("Invalid header ID\n");
 				WARN_ON_RATELIMIT_IPA(1);
 				return -EFAULT;
 			}
@@ -1280,6 +1281,7 @@ int ipa3_reset_hdr(bool user_only)
 						entry->phys_base,
 						entry->hdr_len,
 						DMA_TO_DEVICE);
+					entry->proc_ctx->hdr = NULL;
 					entry->proc_ctx = NULL;
 				} else {
 					/* move the offset entry to free list */
@@ -1338,6 +1340,7 @@ int ipa3_reset_hdr(bool user_only)
 
 		if (ipa3_id_find(ctx_entry->id) == NULL) {
 			mutex_unlock(&ipa3_ctx->lock);
+			IPAERR_RL("Invalid proc header ID\n");
 			WARN_ON_RATELIMIT_IPA(1);
 			return -EFAULT;
 		}