From ea8229b78899bd1edee3051686a4370e5dd56762 Mon Sep 17 00:00:00 2001 From: Frank Rowand Date: Fri, 28 Oct 2016 23:26:28 -0700 Subject: of: Remove redundant size check Remove a redundant check of buffer size. Signed-off-by: Frank Rowand Signed-off-by: Rob Herring --- drivers/of/resolver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/of/resolver.c') diff --git a/drivers/of/resolver.c b/drivers/of/resolver.c index 708daca1d522..76c09cb57eae 100644 --- a/drivers/of/resolver.c +++ b/drivers/of/resolver.c @@ -216,7 +216,7 @@ static int adjust_local_phandle_references(struct device_node *local_fixups, for (i = 0; i < count; i++) { off = be32_to_cpu(((__be32 *)prop_fix->value)[i]); - if (off >= prop->length || (off + 4) > prop->length) + if ((off + 4) > prop->length) return -EINVAL; phandle = be32_to_cpu(*(__be32 *)(prop->value + off)); -- cgit v1.2.3