]> xenbits.xensource.com Git - legacy/linux-2.6.18-xen.git/commitdiff
xen/blkfront: fix data size for xenbus_gather in connect()
authorJan Beulich <jbeulich@novell.com>
Mon, 9 May 2011 09:02:19 +0000 (10:02 +0100)
committerJan Beulich <jbeulich@novell.com>
Mon, 9 May 2011 09:02:19 +0000 (10:02 +0100)
From: Marek Marczykowski <marmarek@mimuw.edu.pl>

barrier variable is int, not long. This overflow caused another
variable override: "err" (in PV code) and "binfo" (in xenlinux code -
drivers/xen/blkfront/blkfront.c). The latter caused incorrect device
flags (RO/removable etc).

Signed-off-by: Marek Marczykowski <marmarek@mimuw.edu.pl>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@novell.com>
drivers/xen/blkfront/blkfront.c

index fdf43b7534c93f9c35201ef2f3f6ef8b544fb94c..92d9776136548396592a3ea110b36976d15ff3b9 100644 (file)
@@ -360,7 +360,7 @@ static void connect(struct blkfront_info *info)
        }
 
        err = xenbus_gather(XBT_NIL, info->xbdev->otherend,
-                           "feature-barrier", "%lu", &info->feature_barrier,
+                           "feature-barrier", "%d", &info->feature_barrier,
                            NULL);
        if (err)
                info->feature_barrier = 0;