[PATCH 1/3] blk-mq: Sanity check reserved tags

From: Alexander Gordeev
Date: Fri Aug 02 2013 - 10:03:51 EST


Signed-off-by: Alexander Gordeev <agordeev@xxxxxxxxxx>
---
block/blk-mq-tag.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c
index dcbc2a4..6718007 100644
--- a/block/blk-mq-tag.c
+++ b/block/blk-mq-tag.c
@@ -335,6 +335,8 @@ static void __blk_mq_put_reserved_tag(struct blk_mq_tags *tags,
{
unsigned long flags;

+ BUG_ON(tag >= tags->reserved_tags);
+
spin_lock_irqsave(&tags->lock, flags);
tags->reservelist[tags->nr_reserved] = tag;
tags->nr_reserved++;
--
1.7.7.6


--
Regards,
Alexander Gordeev
agordeev@xxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/