[PATCH -next] staging/lustre: fix return value check in libcfs_sock_ioctl()

From: Wei Yongjun
Date: Sun Jun 02 2013 - 22:08:22 EST


From: Wei Yongjun <yongjun_wei@xxxxxxxxxxxxxxxxx>

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@xxxxxxxxxxxxxxxxx>
---
no compile test
---
drivers/staging/lustre/lustre/libcfs/linux/linux-tcpip.c | 4 ++--
1 file 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 6f1f047..855c7e8 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;
}


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/