summaryrefslogtreecommitdiffstats
path: root/drivers/xen/pvcalls-front.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2017-12-05 17:38:43 +0300
committerBoris Ostrovsky <boris.ostrovsky@oracle.com>2017-12-06 09:44:43 -0500
commit8c71fa88f7778eb093ee22cba13a3813a82113ad (patch)
tree4a5396a6028cbb51a5caf2397f61f6853a30f5da /drivers/xen/pvcalls-front.c
parent646d944c2ef5a3b298c4e150494c71b9272d8b47 (diff)
downloadop-kernel-dev-8c71fa88f7778eb093ee22cba13a3813a82113ad.zip
op-kernel-dev-8c71fa88f7778eb093ee22cba13a3813a82113ad.tar.gz
xen/pvcalls: check for xenbus_read() errors
Smatch complains that "len" is uninitialized if xenbus_read() fails so let's add some error handling. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Juergen Gross <jgross@suse.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Diffstat (limited to 'drivers/xen/pvcalls-front.c')
-rw-r--r--drivers/xen/pvcalls-front.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/xen/pvcalls-front.c b/drivers/xen/pvcalls-front.c
index 40caa92..afa3f1b 100644
--- a/drivers/xen/pvcalls-front.c
+++ b/drivers/xen/pvcalls-front.c
@@ -1128,6 +1128,8 @@ static int pvcalls_front_probe(struct xenbus_device *dev,
}
versions = xenbus_read(XBT_NIL, dev->otherend, "versions", &len);
+ if (IS_ERR(versions))
+ return PTR_ERR(versions);
if (!len)
return -EINVAL;
if (strcmp(versions, "1")) {
OpenPOWER on IntegriCloud