Skip to content

Commit

Permalink
xen/9pfs: fix return value check in xen_9pfs_front_probe()
Browse files Browse the repository at this point in the history
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: 71ebd71 ("xen/9pfs: connect to the backend")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
  • Loading branch information
Wei Yongjun authored and Stefano Stabellini committed May 18, 2017
1 parent 69861e0 commit 14e3995
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/9p/trans_xen.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 14e3995

Please sign in to comment.