提交 f02dcdd1 编写于 作者: J Juergen Lock 提交者: Mauro Carvalho Chehab

[media] media: rc: rdev->open or rdev->close can be NULL

At least technisat-usb2.c doesn't set these...
Signed-off-by: NJuergen Lock <nox@jelal.kn-bremen.de>
Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
上级 5be789fc
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册