diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/rc/rc-main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c index aa5d8e72462..46da365c9c8 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) return -EINVAL; mutex_lock(&rdev->lock); - if (!rdev->users++) + if (!rdev->users++ && rdev->open != NULL) rval = rdev->open(rdev); if (rval) @@ -735,7 +735,7 @@ void rc_close(struct rc_dev *rdev) if (rdev) { mutex_lock(&rdev->lock); - if (!--rdev->users) + if (!--rdev->users && rdev->close != NULL) rdev->close(rdev); mutex_unlock(&rdev->lock); |