[media] rc_core: avoid kernel oops when rmmod saa7134
authorHussam Al-Tayeb <ht990332@gmail.com>
Mon, 21 Feb 2011 18:20:26 +0000 (15:20 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 29 Apr 2011 14:45:52 +0000 (11:45 -0300)
The following is a patch to avoid a kernel oops when running rmmod
saa7134 on kernel 2.6.27.1. The change is as suggested by mchehab on
irc.freenode.org

Signed-off-by: Hussam Al-Tayeb <ht990332@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/rc/rc-main.c

index 9f0a2d9f3d1ed4cfd212c063cc2e6c5b6dd89c6b..33afd98938da5ad7f86be58efccf3d1889dc2c4f 100644 (file)
@@ -707,7 +707,8 @@ static void ir_close(struct input_dev *idev)
 {
        struct rc_dev *rdev = input_get_drvdata(idev);
 
-       rdev->close(rdev);
+        if (rdev)
+               rdev->close(rdev);
 }
 
 /* class for /sys/class/rc */