diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2017-05-16 10:22:47 -0400 |
---|---|---|
committer | Stefano Stabellini <sstabellini@kernel.org> | 2017-05-18 14:42:32 -0400 |
commit | 14e3995e63759b80eb22a3c06958d105db4d3f79 (patch) | |
tree | 683e8a787d1a45bb593c2f45a1042bd60428a79f /net/9p | |
parent | 69861e0a52f8733355ce246f0db15e1b240ad667 (diff) |
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')
-rw-r--r-- | net/9p/trans_xen.c | 4 |
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, | |||
454 | goto error_xenbus; | 454 | goto error_xenbus; |
455 | } | 455 | } |
456 | priv->tag = xenbus_read(xbt, dev->nodename, "tag", NULL); | 456 | priv->tag = xenbus_read(xbt, dev->nodename, "tag", NULL); |
457 | if (!priv->tag) { | 457 | if (IS_ERR(priv->tag)) { |
458 | ret = -EINVAL; | 458 | ret = PTR_ERR(priv->tag); |
459 | goto error_xenbus; | 459 | goto error_xenbus; |
460 | } | 460 | } |
461 | ret = xenbus_transaction_end(xbt, 0); | 461 | ret = xenbus_transaction_end(xbt, 0); |