diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2013-05-13 15:00:01 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-05-27 13:51:45 +0200 |
commit | d017650b40b4cb5c4158e3b9af38af164986b022 (patch) | |
tree | 5d4379494c3a5047b7cb00e1b498c022fa8acef2 /drivers | |
parent | [media] blackfin: fix error return code in bcap_probe() (diff) | |
download | linux-d017650b40b4cb5c4158e3b9af38af164986b022.tar.xz linux-d017650b40b4cb5c4158e3b9af38af164986b022.zip |
[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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/pci/sta2x11/sta2x11_vip.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/pci/sta2x11/sta2x11_vip.c b/drivers/media/pci/sta2x11/sta2x11_vip.c index 7005695aa4bd..77edc113e485 100644 --- a/drivers/media/pci/sta2x11/sta2x11_vip.c +++ b/drivers/media/pci/sta2x11/sta2x11_vip.c @@ -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", |