[PATCH] [media] dm1105: release dvbnet on frontend attachment failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch "dm1105: handle errors from dvb_net_init" moved the
initialization of dvbnet to before frontend attachment but forgot
to adjust the error handling when frontend attachment fails.

Signed-off-by: Jonathan Nieder <jrnieder@xxxxxxxxx>
---
Mauro Carvalho Chehab wrote:

> Subject: [media] dm1105: handle errors from dvb_net_init
[...]
> --- a/drivers/media/dvb/dm1105/dm1105.c
> +++ b/drivers/media/dvb/dm1105/dm1105.c
> @@ -1115,11 +1115,14 @@ static int __devinit dm1105_probe(struct pci_dev *pdev,
>  	if (ret < 0)
>  		goto err_remove_mem_frontend;
>  
> +	ret = dvb_net_init(dvb_adapter, &dev->dvbnet, dmx);
> +	if (ret < 0)
> +		goto err_disconnect_frontend;
> +
>  	ret = frontend_init(dev);
>  	if (ret < 0)
>  		goto err_disconnect_frontend;
>  
> -	dvb_net_init(dvb_adapter, &dev->dvbnet, dmx);

This looks bogus --- my fault, sorry.  Here's a fixup on top.

If create_singlethread_workqueue or a later step fails, I suspect this
still might not clean up as much as it should.  E.g., I expected to find
something like

	if (dev->fe->ops.release)
		dev->fe->ops.release(dev->fe);

somewhere in the cleanup code.

 drivers/media/dvb/dm1105/dm1105.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/dvb/dm1105/dm1105.c b/drivers/media/dvb/dm1105/dm1105.c
index 70e040b999e7..a609b3a9b146 100644
--- a/drivers/media/dvb/dm1105/dm1105.c
+++ b/drivers/media/dvb/dm1105/dm1105.c
@@ -1121,7 +1121,7 @@ static int __devinit dm1105_probe(struct pci_dev *pdev,
 
 	ret = frontend_init(dev);
 	if (ret < 0)
-		goto err_disconnect_frontend;
+		goto err_dvb_net;
 
 	dm1105_ir_init(dev);
 
-- 
1.7.8.2

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux