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

Commit 38b227b0 authored by Sunil Paidimarri's avatar Sunil Paidimarri
Browse files

msm: ipa: Add guard around nat entries read



Add mutext lock protection around nat read
functino in debugfs to avoid nat table delete
during read.

Change-Id: Id38737dad70853ccd83685841d0c2498ee722ff2
CRs-Fixed: 1075605
Signed-off-by: default avatarSunil Paidimarri <hisunil@codeaurora.org>
parent 3c7400dc
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1420,6 +1420,7 @@ static ssize_t ipa_read_nat4(struct file *file,
	u16 enable, tbl_entry, flag;
	u32 no_entrys = 0;

	mutex_lock(&ipa_ctx->nat_mem.lock);
	value = ipa_ctx->nat_mem.public_ip_addr;
	pr_err(
				"Table IP Address:%d.%d.%d.%d\n",
@@ -1573,6 +1574,7 @@ static ssize_t ipa_read_nat4(struct file *file,
		}
	}
	pr_err("Current No. Nat Entries: %d\n", no_entrys);
	mutex_unlock(&ipa_ctx->nat_mem.lock);

	return 0;
}
+2 −0
Original line number Diff line number Diff line
@@ -1478,6 +1478,7 @@ static ssize_t ipa3_read_nat4(struct file *file,
	u16 enable, tbl_entry, flag;
	u32 no_entrys = 0;

	mutex_lock(&ipa3_ctx->nat_mem.lock);
	value = ipa3_ctx->nat_mem.public_ip_addr;
	pr_err(
				"Table IP Address:%d.%d.%d.%d\n",
@@ -1631,6 +1632,7 @@ static ssize_t ipa3_read_nat4(struct file *file,
		}
	}
	pr_err("Current No. Nat Entries: %d\n", no_entrys);
	mutex_unlock(&ipa3_ctx->nat_mem.lock);

	return 0;
}