xen/9pfs: fix return value check in xen_9pfs_front_probe()
authorWei Yongjun <weiyongjun1@huawei.com>
Tue, 16 May 2017 14:22:47 +0000 (14:22 +0000)
committerStefano Stabellini <sstabellini@kernel.org>
Thu, 18 May 2017 18:42:32 +0000 (11:42 -0700)
In case of error, the function xenbus_read() returns ERR_PTR() and never
returns NULL. The NULL test in the return value check should be replaced
with IS_ERR().

Fixes: 71ebd71921e4 ("xen/9pfs: connect to the backend")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
net/9p/trans_xen.c

index 71e85643b3f96db09de3330263f556fedba65257..83fe487f460ef8c5c38af2b90b71536b018ab639 100644 (file)
@@ -454,8 +454,8 @@ static int xen_9pfs_front_probe(struct xenbus_device *dev,
                        goto error_xenbus;
        }
        priv->tag = xenbus_read(xbt, dev->nodename, "tag", NULL);
-       if (!priv->tag) {
-               ret = -EINVAL;
+       if (IS_ERR(priv->tag)) {
+               ret = PTR_ERR(priv->tag);
                goto error_xenbus;
        }
        ret = xenbus_transaction_end(xbt, 0);