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>
This commit is contained in:
parent
646d944c2e
commit
8c71fa88f7
1 changed files with 2 additions and 0 deletions
|
@ -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")) {
|
||||
|
|
Loading…
Reference in a new issue