WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [linux-2.6.18-xen] blkback: don't call vbd_size() if bd_

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] blkback: don't call vbd_size() if bd_disk is NULL
From: Xen patchbot-linux-2.6.18-xen <patchbot@xxxxxxx>
Date: Thu, 26 May 2011 08:20:22 +0100
Delivery-date: Thu, 26 May 2011 00:20:44 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Laszlo Ersek <lersek@xxxxxxxxxx>
# Date 1306393744 -3600
# Node ID aedb712c05cf065e943e15d0f38597c2e80f7982
# Parent  e7c536b81b6ae4d61069922d65fe2bf5e2b77d29
blkback: don't call vbd_size() if bd_disk is NULL

...because vbd_size() dereferences bd_disk if bd_part is NULL.

Signed-off-by: Laszlo Ersek<lersek@xxxxxxxxxx>
Acked-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---


diff -r e7c536b81b6a -r aedb712c05cf drivers/xen/blkback/vbd.c
--- a/drivers/xen/blkback/vbd.c Thu May 26 08:07:05 2011 +0100
+++ b/drivers/xen/blkback/vbd.c Thu May 26 08:09:04 2011 +0100
@@ -73,7 +73,6 @@
        }
 
        vbd->bdev = bdev;
-       vbd->size = vbd_size(vbd);
 
        if (vbd->bdev->bd_disk == NULL) {
                DPRINTK("vbd_creat: device %08x doesn't exist.\n",
@@ -82,6 +81,8 @@
                return -ENOENT;
        }
 
+       vbd->size = vbd_size(vbd);
+
        if (vbd->bdev->bd_disk->flags & GENHD_FL_CD || cdrom)
                vbd->type |= VDISK_CDROM;
        if (vbd->bdev->bd_disk->flags & GENHD_FL_REMOVABLE)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] blkback: don't call vbd_size() if bd_disk is NULL, Xen patchbot-linux-2 . 6 . 18-xen <=