[PATCH] drm/tilcdc: uninitialized variable in tilcdc_get_overlay()
Dan Carpenter
dan.carpenter at oracle.com
Tue Nov 14 06:14:35 UTC 2017
The code seems to assume that of_fdt_unflatten_tree() sets "overlay" to
NULL on error but actually it could be uninitialized.
Fixes: 4e7221580223 ("drm/tilcdc: Add DRM_TILCDC_SLAVE_COMPAT for ti,tilcdc,slave binding support")
Signed-off-by: Dan Carpenter <dan.carpenter at oracle.com>
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c b/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c
index d2b9e5f04724..a8a70b36f0ff 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c
@@ -144,7 +144,7 @@ static struct device_node * __init tilcdc_get_overlay(struct kfree_table *kft)
const int size = __dtb_tilcdc_slave_compat_end -
__dtb_tilcdc_slave_compat_begin;
static void *overlay_data;
- struct device_node *overlay;
+ struct device_node *overlay = NULL;
if (!size) {
pr_warn("%s: No overlay data\n", __func__);
More information about the dri-devel
mailing list