Skip to contentSkip to conversation

em28xx: Fix IR unregister logic

PATCH In review Mauro Carvalho Chehab 2 participants 2 messages Jul 29, 2011 1 message not in the archive Media (V4L/DVB)

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): d2fea3477b6527f29b946f6aa5842398d72c3a1e.1311918789.git.mchehab@redhat.com

#1 lore raw

PATCH 2/2 em28xx: Fix IR unregister logic

The input stop() callback already calls the em28xx_ir_stop method. Calling it again causes an oops.

drivers/media/video/em28xx/em28xx-input.c +3 -3
index 5d12b14..679da48 100644
@@ -463,11 +463,11 @@ int em28xx_ir_fini(struct em28xx *dev)
 	if (!ir)
 		return 0;
 
-	em28xx_ir_stop(ir->rc);
-	rc_unregister_device(ir->rc);
-	kfree(ir);
+	if (ir->rc)
+		rc_unregister_device(ir->rc);
 
 	/* done */
+	kfree(ir);
 	dev->ir = NULL;
 	return 0;
 }
Signature · 1 line
1.7.1