mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 17:30:02 +00:00
[media] sta2x11_vip: fix error return code in sta2x11_vip_init_one()
The orig code will release all the resources if v4l2_device_register() failed and return 0. But what we need in this case is to return an negative error code to let the caller known we are failed. So the patch save the return value of v4l2_device_register() to 'ret' and return it when error. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
d9fdbeff26
commit
d017650b40
1 changed files with 2 additions and 1 deletions
|
@ -1047,7 +1047,8 @@ static int sta2x11_vip_init_one(struct pci_dev *pdev,
|
|||
ret = sta2x11_vip_init_controls(vip);
|
||||
if (ret)
|
||||
goto free_mem;
|
||||
if (v4l2_device_register(&pdev->dev, &vip->v4l2_dev))
|
||||
ret = v4l2_device_register(&pdev->dev, &vip->v4l2_dev);
|
||||
if (ret)
|
||||
goto free_mem;
|
||||
|
||||
dev_dbg(&pdev->dev, "BAR #0 at 0x%lx 0x%lx irq %d\n",
|
||||
|
|
Loading…
Reference in a new issue