Explorar el Código

Merge "msm: ipa3: Fix to validate the NAT table entries during NAT table init"

qctecmdr hace 3 años
padre
commit
abe5fec384
Se han modificado 1 ficheros con 3 adiciones y 2 borrados
  1. 3 2
      drivers/platform/msm/ipa/ipa_v3/ipa_nat.c

+ 3 - 2
drivers/platform/msm/ipa/ipa_v3/ipa_nat.c

@@ -1441,8 +1441,9 @@ int ipa3_nat_init_cmd(
 		goto bail;
 	}
 
-	if (init->table_entries == 0) {
-		IPAERR_RL("Table entries is zero\n");
+	if (init->table_entries == 0 ||
+		init->table_entries == U16_MAX) {
+		IPAERR_RL("Table entries is %d\n", init->table_entries);
 		result = -EPERM;
 		goto bail;
 	}