From: Wei Yongjun Date: Mon, 3 Jun 2013 02:08:13 +0000 (+0800) Subject: staging/lustre: fix return value check in libcfs_sock_ioctl() X-Git-Tag: Ubuntu-snapdragon-4.4.0-1029.32~10672^2~325 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=b3c1afd1fa366ef733a9f16c493a03396d7e4ab5;p=mirror_ubuntu-zesty-kernel.git 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 Signed-off-by: Greg Kroah-Hartman --- 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; }