提交 418d59ef 编写于 作者: D Dan Carpenter 提交者: Boris Brezillon

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: ebc94461 ("drm: convert drivers to use drm_of_find_panel_or_bridge")
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170415192142.GA6416@mwanda
上级 2f410f88
......@@ -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;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册