[media] dvbdev: returns error if graph object creation fails
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>
Fri, 4 Sep 2015 18:10:29 +0000 (15:10 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Mon, 11 Jan 2016 14:18:57 +0000 (12:18 -0200)
commitf50d51661af375c40cae894753e8cd9b1fe82c65
tree1e0b1ff69cbb3c6ce4d14202749c3463bce57fb1
parenteb83a5176801d53f9f78eff8c0bf03e627110206
[media] dvbdev: returns error if graph object creation fails

Right now, if something gets wrong at dvb_create_media_entity()
or at dvb_create_media_graph(), the device will still be
registered.

Change the logic to properly handle it and free all media graph
objects if something goes wrong at dvb_register_device().

Also, change the logic at dvb_create_media_graph() to return
an error code if something goes wrong. It is up to the
caller to implement the right logic and to call
dvb_unregister_device() to unregister the already-created
objects.

While here, add a missing logic to unregister the created
interfaces.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/dvb-core/dvbdev.c
drivers/media/dvb-core/dvbdev.h
drivers/media/media-device.c
This page took 0.026812 seconds and 5 git commands to generate.