Skip to content

Commit

Permalink
xen/pvcalls: check for xenbus_read() errors
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and Boris Ostrovsky committed Dec 6, 2017
1 parent 646d944 commit 8c71fa8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/xen/pvcalls-front.c
Original file line number Diff line number Diff line change
Expand Up @@ -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")) {
Expand Down

0 comments on commit 8c71fa8

Please sign in to comment.