summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChengguang Xu <cgxu519@gmx.com>2019-01-19 21:15:34 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-01-22 12:03:16 +0100
commit54557665a4e776a1affa132faea87bc60c452617 (patch)
treee32e9ff590e6d59e5f8bb07918a74b0818a2c253
parent1e09cdd506c8833a9d52cb61009798660cff4051 (diff)
downloadlwn-54557665a4e776a1affa132faea87bc60c452617.tar.gz
lwn-54557665a4e776a1affa132faea87bc60c452617.zip
uio: remove redundant check
It is not necessary to check idev->info several times under mutex lock, so just remove redundant check. Signed-off-by: Chengguang Xu <cgxu519@gmx.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/uio/uio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
index 46e5c1c31ebe..effe72834c2f 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -494,7 +494,7 @@ static int uio_open(struct inode *inode, struct file *filep)
goto err_infoopen;
}
- if (idev->info && idev->info->open)
+ if (idev->info->open)
ret = idev->info->open(idev->info, inode);
mutex_unlock(&idev->info_lock);
if (ret)
@@ -635,7 +635,7 @@ static ssize_t uio_write(struct file *filep, const char __user *buf,
goto out;
}
- if (!idev->info || !idev->info->irq) {
+ if (!idev->info->irq) {
retval = -EIO;
goto out;
}