mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-13 14:14:37 +00:00
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: ebc9446135
("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
This commit is contained in:
parent
2f410f88c0
commit
418d59ef22
1 changed files with 2 additions and 3 deletions
|
@ -221,7 +221,8 @@ static int atmel_hlcdc_attach_endpoint(struct drm_device *dev,
|
|||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue