summaryrefslogtreecommitdiff
path: root/drivers/staging/lustre
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2013-06-03 06:08:13 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-06-03 23:10:47 +0400
commitb3c1afd1fa366ef733a9f16c493a03396d7e4ab5 (patch)
tree4ebb00f8cad7f1910fa33d07066bea9f341f427e /drivers/staging/lustre
parent49c02a75708457b629bba47aed0ba28b2cabf4a1 (diff)
downloadlinux-b3c1afd1fa366ef733a9f16c493a03396d7e4ab5.tar.xz
staging/lustre: fix return value check in libcfs_sock_ioctl()
In case of error, the function sock_alloc_file() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre')
-rw-r--r--drivers/staging/lustre/lustre/libcfs/linux/linux-tcpip.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-tcpip.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-tcpip.c
index 6f1f047d6555..855c7e87d96f 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-tcpip.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-tcpip.c
@@ -59,9 +59,9 @@ libcfs_sock_ioctl(int cmd, unsigned long arg)
}
sock_filp = sock_alloc_file(sock, 0, NULL);
- if (!sock_filp) {
+ if (IS_ERR(sock_filp)) {
sock_release(sock);
- rc = -ENOMEM;
+ rc = PTR_ERR(sock_filp);
goto out;
}