Merge "platform: msm_shared: check if valp is NULL before using it."
diff --git a/platform/msm_shared/dev_tree.c b/platform/msm_shared/dev_tree.c
index e4505d4..b139cf2 100644
--- a/platform/msm_shared/dev_tree.c
+++ b/platform/msm_shared/dev_tree.c
@@ -623,7 +623,7 @@
 
 	/* Find the #address-cells size. */
 	valp = (uint32_t*)fdt_getprop(fdt, offset, "#address-cells", &len);
-	if (len <= 0)
+	if (len <= 0 || !valp)
 	{
 		if (len == -FDT_ERR_NOTFOUND)
 		{
@@ -644,7 +644,7 @@
 
 	/* Find the #size-cells size. */
 	valp = (uint32_t*)fdt_getprop(fdt, offset, "#size-cells", &len);
-	if (len <= 0)
+	if (len <= 0 || !valp)
 	{
 		if (len == -FDT_ERR_NOTFOUND)
 		{