Skip to contentSkip to conversation

[2.6] Fix error path in Video4Linux dpc7146 driver

PATCH New Michael Hunold 1 participant 1 message Oct 5, 2004 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 [2.6] Fix error path in Video4Linux dpc7146 driver

Hi,

this patch fixes an error path in my dpc7146 Video4Linux driver.

The I2C adapter wasn't de-registered correctly in case the video card wasn't found. When the I2C subsystem tried to speak with the dangling I2C adapter later on, usually an oops happened.

Please apply.

Regards
Michael Hunold.

drivers/media/video/dpc7146.c +1 -0
diff -ura linux-2.6.9-rc3/drivers/media/video/dpc7146.c b/drivers/media/video/dpc7146.c
@@ -123,6 +123,7 @@
 	/* check if all devices are present */
 	if( 0 == dpc->saa7111a ) {
 		DEB_D(("dpc_v4l2.o: dpc_attach failed for this device.\n"));	
+		i2c_del_adapter(&dpc->i2c_adapter);
 		kfree(dpc);
 		return -ENODEV;
 	}