Commit 14e3995e authored by Wei Yongjun's avatar Wei Yongjun Committed by Stefano Stabellini

xen/9pfs: fix return value check in xen_9pfs_front_probe()

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: 71ebd719 ("xen/9pfs: connect to the backend")
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: default avatarStefano Stabellini <sstabellini@kernel.org>
parent 69861e0a
...@@ -454,8 +454,8 @@ static int xen_9pfs_front_probe(struct xenbus_device *dev, ...@@ -454,8 +454,8 @@ static int xen_9pfs_front_probe(struct xenbus_device *dev,
goto error_xenbus; goto error_xenbus;
} }
priv->tag = xenbus_read(xbt, dev->nodename, "tag", NULL); priv->tag = xenbus_read(xbt, dev->nodename, "tag", NULL);
if (!priv->tag) { if (IS_ERR(priv->tag)) {
ret = -EINVAL; ret = PTR_ERR(priv->tag);
goto error_xenbus; goto error_xenbus;
} }
ret = xenbus_transaction_end(xbt, 0); ret = xenbus_transaction_end(xbt, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment