From: Dan Carpenter Date: Sat, 15 Apr 2017 19:21:42 +0000 (+0300) Subject: drm: atmel-hlcdc: Uninitialized return in atmel_hlcdc_create_outputs() X-Git-Tag: v5.15~11060^2~7^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=418d59ef229290a1da80aa25222f9da2ac2fa6a5;p=platform%2Fkernel%2Flinux-starfive.git drm: atmel-hlcdc: Uninitialized return in atmel_hlcdc_create_outputs() It's not possible for endpoint to be zero so the test doesn't work. If we break on the first iteration through the loop then endpoint is 1 and "ret" is uninitialized. Fixes: ebc944613567 ("drm: convert drivers to use drm_of_find_panel_or_bridge") Signed-off-by: Dan Carpenter Signed-off-by: Boris Brezillon Link: http://patchwork.freedesktop.org/patch/msgid/20170415192142.GA6416@mwanda --- diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c index f987b45..65a3bd7 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c @@ -221,7 +221,8 @@ err_encoder_cleanup: int atmel_hlcdc_create_outputs(struct drm_device *dev) { struct device_node *remote; - int ret, endpoint = 0; + int ret = -ENODEV; + int endpoint = 0; while (true) { /* Loop thru possible multiple connections to the output */ @@ -236,7 +237,5 @@ int atmel_hlcdc_create_outputs(struct drm_device *dev) return ret; } - if (!endpoint) - return -ENODEV; return ret; }