From: Wei Yongjun <[email protected]>

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 <[email protected]>
---
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;
        }
 

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel

Reply via email to