Linux-commit:
b3c1afd1fa366ef733a9f16c493a03396d7e4ab5
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>
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Change-Id: Ib1e04da4ab2d637a632f0b4e84f38ed6b114e27e
Reviewed-on: http://review.whamcloud.com/15125
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Isaac Huang <he.huang@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
sock_filp = sock_alloc_file(sock, 0);
# endif
#endif
- if (!sock_filp) {
- rc = -ENOMEM;
+ if (IS_ERR(sock_filp)) {
+ rc = PTR_ERR(sock_filp);
sock_release(sock);
goto out;
}