From: Mikulas Patocka Date: Tue, 15 Jul 2008 21:18:38 +0000 (-0400) Subject: BUG_ON on kernel misbehavior on A100U2W driver X-Git-Tag: accepted/tizen/common/20141203.182822~21495 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a5db33411ae762e597bfcde6bb9d0c8c2ea9c0eb;p=platform%2Fkernel%2Flinux-arm64.git BUG_ON on kernel misbehavior on A100U2W driver With broken Sparc64 IOMMU accounting, the kernel submits larger requests then allowed. Better to crash on BUG than corrupt memory. Signed-off-by: Mikulas Patocka Acked-by: James Bottomley Signed-off-by: Linus Torvalds --- diff --git a/drivers/scsi/a100u2w.c b/drivers/scsi/a100u2w.c index 1e8bdd4..f5051f4 100644 --- a/drivers/scsi/a100u2w.c +++ b/drivers/scsi/a100u2w.c @@ -866,6 +866,7 @@ static void inia100_build_scb(struct orc_host * host, struct orc_scb * scb, stru count_sg = scsi_dma_map(cmd); BUG_ON(count_sg < 0); + BUG_ON(count_sg > TOTAL_SG_ENTRY); /* Build the scatter gather lists */ if (count_sg) {