Commit f36592e7 authored by Dan Carpenter's avatar Dan Carpenter Committed by Mauro Carvalho Chehab

media: vicodec: Fix error codes in probe function

If these functions fail then we return success, but we should instead
preserve negative error code and return that.

Fixes: fde649b4 ("media: vicodec: Register another node for stateless decoder")
Fixes: c022a4a9 ("media: vicodec: add struct for encoder/decoder instance")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent d00c9761
...@@ -2114,16 +2114,19 @@ static int vicodec_probe(struct platform_device *pdev) ...@@ -2114,16 +2114,19 @@ static int vicodec_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, dev); platform_set_drvdata(pdev, dev);
if (register_instance(dev, &dev->stateful_enc, ret = register_instance(dev, &dev->stateful_enc, "stateful-encoder",
"stateful-encoder", true)) true);
if (ret)
goto unreg_dev; goto unreg_dev;
if (register_instance(dev, &dev->stateful_dec, ret = register_instance(dev, &dev->stateful_dec, "stateful-decoder",
"stateful-decoder", false)) false);
if (ret)
goto unreg_sf_enc; goto unreg_sf_enc;
if (register_instance(dev, &dev->stateless_dec, ret = register_instance(dev, &dev->stateless_dec, "stateless-decoder",
"stateless-decoder", false)) false);
if (ret)
goto unreg_sf_dec; goto unreg_sf_dec;
#ifdef CONFIG_MEDIA_CONTROLLER #ifdef CONFIG_MEDIA_CONTROLLER
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment