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

Commit a25b36b4 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: ipa: Fix to unsigned integer underflow"

parents 02e86bbf 2cbe2994
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -1455,6 +1455,10 @@ static ssize_t ipa_read_nat4(struct file *file,
	pr_err("Table Size:%d\n",
				ipa_ctx->nat_mem.size_base_tables);

	if (!ipa_ctx->nat_mem.size_expansion_tables)
		pr_err("Expansion Table Size:%d\n",
				ipa_ctx->nat_mem.size_expansion_tables);
	else
		pr_err("Expansion Table Size:%d\n",
				ipa_ctx->nat_mem.size_expansion_tables-1);

@@ -1470,6 +1474,8 @@ static ssize_t ipa_read_nat4(struct file *file,

			pr_err("\nBase Table:\n");
		} else {
			if (!ipa_ctx->nat_mem.size_expansion_tables)
				continue;
			tbl_size = ipa_ctx->nat_mem.size_expansion_tables-1;
			base_tbl =
			 (u32 *)ipa_ctx->nat_mem.ipv4_expansion_rules_addr;
@@ -1569,6 +1575,8 @@ static ssize_t ipa_read_nat4(struct file *file,

			pr_err("\nIndex Table:\n");
		} else {
			if (!ipa_ctx->nat_mem.size_expansion_tables)
				continue;
			tbl_size = ipa_ctx->nat_mem.size_expansion_tables-1;
			indx_tbl =
			 (u32 *)ipa_ctx->nat_mem.index_table_expansion_addr;