diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2017-04-15 15:21:42 -0400 |
---|---|---|
committer | Boris Brezillon <boris.brezillon@free-electrons.com> | 2017-04-18 05:52:45 -0400 |
commit | 418d59ef229290a1da80aa25222f9da2ac2fa6a5 (patch) | |
tree | 6b3aff7ee3c42221aedab514006a82482541a575 | |
parent | 2f410f88c0a1c7e19762918d2614f506a7b63a82 (diff) |
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 <dan.carpenter@oracle.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170415192142.GA6416@mwanda
-rw-r--r-- | drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c index f987b4572d4a..65a3bd7a0c00 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: | |||
221 | int atmel_hlcdc_create_outputs(struct drm_device *dev) | 221 | int atmel_hlcdc_create_outputs(struct drm_device *dev) |
222 | { | 222 | { |
223 | struct device_node *remote; | 223 | struct device_node *remote; |
224 | int ret, endpoint = 0; | 224 | int ret = -ENODEV; |
225 | int endpoint = 0; | ||
225 | 226 | ||
226 | while (true) { | 227 | while (true) { |
227 | /* Loop thru possible multiple connections to the output */ | 228 | /* Loop thru possible multiple connections to the output */ |
@@ -236,7 +237,5 @@ int atmel_hlcdc_create_outputs(struct drm_device *dev) | |||
236 | return ret; | 237 | return ret; |
237 | } | 238 | } |
238 | 239 | ||
239 | if (!endpoint) | ||
240 | return -ENODEV; | ||
241 | return ret; | 240 | return ret; |
242 | } | 241 | } |