aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/rc
diff options
context:
space:
mode:
authorJuergen Lock <nox@jelal.kn-bremen.de>2013-08-16 14:00:24 -0400
committerMauro Carvalho Chehab <m.chehab@samsung.com>2013-08-23 04:41:23 -0400
commitf02dcdd1784d2b56ffa8c528248b60ef142e921d (patch)
tree3d9209cf417a8251e98fbb5729e5cc55f29605c4 /drivers/media/rc
parent5be789fc84a752946f6bdf263b053ed7d4a12a1c (diff)
[media] media: rc: rdev->open or rdev->close can be NULL
At least technisat-usb2.c doesn't set these... Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/rc')
-rw-r--r--drivers/media/rc/rc-main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
index aa5d8e724622..46da365c9c84 100644
--- a/drivers/media/rc/rc-main.c
+++ b/drivers/media/rc/rc-main.c
@@ -711,7 +711,7 @@ int rc_open(struct rc_dev *rdev)
711 return -EINVAL; 711 return -EINVAL;
712 712
713 mutex_lock(&rdev->lock); 713 mutex_lock(&rdev->lock);
714 if (!rdev->users++) 714 if (!rdev->users++ && rdev->open != NULL)
715 rval = rdev->open(rdev); 715 rval = rdev->open(rdev);
716 716
717 if (rval) 717 if (rval)
@@ -735,7 +735,7 @@ void rc_close(struct rc_dev *rdev)
735 if (rdev) { 735 if (rdev) {
736 mutex_lock(&rdev->lock); 736 mutex_lock(&rdev->lock);
737 737
738 if (!--rdev->users) 738 if (!--rdev->users && rdev->close != NULL)
739 rdev->close(rdev); 739 rdev->close(rdev);
740 740
741 mutex_unlock(&rdev->lock); 741 mutex_unlock(&rdev->lock);