diff options
author | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-09-02 08:54:01 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-09-07 16:02:51 +0200 |
commit | 49a3d74b46cb9cc2266c334844b353f65b367732 (patch) | |
tree | 668321974e2b2fa8c2f980e415c7020d2256e562 /drivers | |
parent | 62c6b4c9e3c8e30ba4ad6c85732f00a26c5e4394 (diff) | |
download | lwn-49a3d74b46cb9cc2266c334844b353f65b367732.tar.gz lwn-49a3d74b46cb9cc2266c334844b353f65b367732.zip |
media: vivid: fix error path
If something fails after calling v4l2_device_register(),
it should call v4l2_device_put().
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/test-drivers/vivid/vivid-core.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/media/test-drivers/vivid/vivid-core.c b/drivers/media/test-drivers/vivid/vivid-core.c index 54df7e0c13fc..48809991f037 100644 --- a/drivers/media/test-drivers/vivid/vivid-core.c +++ b/drivers/media/test-drivers/vivid/vivid-core.c @@ -1698,10 +1698,8 @@ static int vivid_create_instance(struct platform_device *pdev, int inst) &has_tuner, &has_modulator, &ccs_cap, &ccs_out, in_type_counter, out_type_counter); - if (ret) { - kfree(dev); - return ret; - } + if (ret) + goto free_dev; vivid_set_capabilities(dev); |