]> Git Repo - linux.git/commitdiff
xen/pvcalls: check for xenbus_read() errors
authorDan Carpenter <[email protected]>
Tue, 5 Dec 2017 14:38:43 +0000 (17:38 +0300)
committerBoris Ostrovsky <[email protected]>
Wed, 6 Dec 2017 14:44:43 +0000 (09:44 -0500)
Smatch complains that "len" is uninitialized if xenbus_read() fails so
let's add some error handling.

Signed-off-by: Dan Carpenter <[email protected]>
Reviewed-by: Juergen Gross <[email protected]>
Reviewed-by: Stefano Stabellini <[email protected]>
Signed-off-by: Boris Ostrovsky <[email protected]>
drivers/xen/pvcalls-front.c

index 40caa92bff33deaebf1bf01aac44571453660c0f..afa3f1b5d807646dc949b410b1f00c327b9825fb 100644 (file)
@@ -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")) {
This page took 0.062883 seconds and 4 git commands to generate.