diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2013-06-03 10:08:13 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-03 12:10:47 -0700 |
commit | b3c1afd1fa366ef733a9f16c493a03396d7e4ab5 (patch) | |
tree | 4ebb00f8cad7f1910fa33d07066bea9f341f427e | |
parent | 49c02a75708457b629bba47aed0ba28b2cabf4a1 (diff) |
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>
-rw-r--r-- | drivers/staging/lustre/lustre/libcfs/linux/linux-tcpip.c | 4 |
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 6f1f047d655..855c7e87d96 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; } |