Skip to contentSkip to conversation

xen/blkfront: beyond ARRAY_SIZE of info->shadow

PATCH In review Roel Kluin 3 participants 3 messages May 21, 2009 – May 22, 2009

Subsystems (4)
lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 xen/blkfront: beyond ARRAY_SIZE of info->shadow

Do not go beyond ARRAY_SIZE of info->shadow

---

drivers/block/xen-blkfront.c +1 -1
index a6cbf7b..d395986 100644
@@ -122,7 +122,7 @@ static DEFINE_SPINLOCK(blkif_io_lock);
 static int get_id_from_freelist(struct blkfront_info *info)
 {
 	unsigned long free = info->shadow_free;
-	BUG_ON(free > BLK_RING_SIZE);
+	BUG_ON(free >= BLK_RING_SIZE);
 	info->shadow_free = info->shadow[free].req.id;
 	info->shadow[free].req.id = 0x0fffffee; /* debug */
 	return free;
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Roel Kluin

Do not go beyond ARRAY_SIZE of info->shadow

Jens, can you put this into a next-merge-window branch?

Thanks,
J

Quoted 21 lines

---

drivers/block/xen-blkfront.c +1 -1
index a6cbf7b..d395986 100644
@@ -122,7 +122,7 @@ static DEFINE_SPINLOCK(blkif_io_lock);
 static int get_id_from_freelist(struct blkfront_info *info)
 {
 	unsigned long free = info->shadow_free;
-	BUG_ON(free > BLK_RING_SIZE);
+	BUG_ON(free >= BLK_RING_SIZE);
 	info->shadow_free = info->shadow[free].req.id;
 	info->shadow[free].req.id = 0x0fffffee; /* debug */
 	return free;

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/virtualization