summaryrefslogtreecommitdiffstats
path: root/drivers/of/resolver.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/of/resolver.c')
-rw-r--r--drivers/of/resolver.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/of/resolver.c b/drivers/of/resolver.c
index 65d0b7adfcd4..7edfac6f1914 100644
--- a/drivers/of/resolver.c
+++ b/drivers/of/resolver.c
@@ -122,6 +122,11 @@ static int update_usages_of_a_phandle_reference(struct device_node *overlay,
goto err_fail;
}
+ if (offset < 0 || offset + sizeof(__be32) > prop->length) {
+ err = -EINVAL;
+ goto err_fail;
+ }
+
*(__be32 *)(prop->value + offset) = cpu_to_be32(phandle);
}