提交 8c71fa88 编写于 作者: D Dan Carpenter 提交者: Boris Ostrovsky

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: NDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: NJuergen Gross <jgross@suse.com>
Reviewed-by: NStefano Stabellini <sstabellini@kernel.org>
Signed-off-by: NBoris Ostrovsky <boris.ostrovsky@oracle.com>
上级 646d944c
......@@ -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")) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册