]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
media: dvb-frontends: rtl2832_sdr: set error code in probe
authorEvgeny Novikov <novikov@ispras.ru>
Mon, 21 Sep 2020 12:30:06 +0000 (14:30 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sun, 27 Sep 2020 09:23:46 +0000 (11:23 +0200)
If rtl2832_sdr_probe() encounters an unsupported tuner it cleans up
everything and returns 0. This can result in various bad things later.
The patch sets the error code on the corresponding path.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Evgeny Novikov <novikov@ispras.ru>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/dvb-frontends/rtl2832_sdr.c

index 720756728f2d2cbae1ecee9d9139b2e69b701cc6..ef6feb299d462e66dea506f97fc4957a15206784 100644 (file)
@@ -1411,6 +1411,7 @@ static int rtl2832_sdr_probe(struct platform_device *pdev)
        default:
                v4l2_ctrl_handler_init(&dev->hdl, 0);
                dev_err(&pdev->dev, "Unsupported tuner\n");
+               ret = -ENODEV;
                goto err_v4l2_ctrl_handler_free;
        }
        if (dev->hdl.error) {