Browse Source

[media] dvb_usb_v2: fix error handling for .tuner_attach()

fe was not set NULL after it was destroyed in tuner attach fail
error case. Due to that it was destroyed again and Kernel oopsed.

Reported-by: Oliver Schinagl <oliver@schinagl.nl>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Antti Palosaari 12 years ago
parent
commit
2a858486e0
1 changed files with 3 additions and 1 deletions
  1. 3 1
      drivers/media/usb/dvb-usb-v2/dvb_usb_core.c

+ 3 - 1
drivers/media/usb/dvb-usb-v2/dvb_usb_core.c

@@ -612,8 +612,10 @@ err_dvb_unregister_frontend:
 
 err_dvb_frontend_detach:
 	for (i = MAX_NO_OF_FE_PER_ADAP - 1; i >= 0; i--) {
-		if (adap->fe[i])
+		if (adap->fe[i]) {
 			dvb_frontend_detach(adap->fe[i]);
+			adap->fe[i] = NULL;
+		}
 	}
 
 err: