xen/9pfs: fix return value check in xen_9pfs_front_probe()
Subsystems (3)
PATCH 1/1 xen/9pfs: fix return value check in xen_9pfs_front_probe()
From: Wei Yongjun <[email protected]>
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 <[email protected]>
--- net/9p/trans_xen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/9p/trans_xen.c +2 -2
@@ -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 );
Quoted 8 lines · Wei Yongjun
From: Wei Yongjun <[email protected]>
In case of error, the function
xenbus_read()returnsERR_PTR()and never returns NULL. The NULL test in the return value check should be replaced withIS_ERR().Fixes 71ebd71921e4 ("xen/9pfs: connect to the backend")Signed-off-by Wei Yongjun <[email protected]>
Reviewed-by Stefano Stabellini <[email protected]>
Thank you!
Quoted 20 lines
--- net/9p/trans_xen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)net/9p/trans_xen.c +2
-2@@ -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 );