summaryrefslogtreecommitdiff
path: root/net/9p/trans_xen.c
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2017-05-16 17:22:47 +0300
committerStefano Stabellini <sstabellini@kernel.org>2017-05-18 21:42:32 +0300
commit14e3995e63759b80eb22a3c06958d105db4d3f79 (patch)
tree683e8a787d1a45bb593c2f45a1042bd60428a79f /net/9p/trans_xen.c
parent69861e0a52f8733355ce246f0db15e1b240ad667 (diff)
downloadlinux-14e3995e63759b80eb22a3c06958d105db4d3f79.tar.xz
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: 71ebd71921e4 ("xen/9pfs: connect to the backend") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Diffstat (limited to 'net/9p/trans_xen.c')
-rw-r--r--net/9p/trans_xen.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/9p/trans_xen.c b/net/9p/trans_xen.c
index 71e85643b3f9..83fe487f460e 100644
--- a/net/9p/trans_xen.c
+++ b/net/9p/trans_xen.c
@@ -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);