[PATCH] icside: icside_dma_setup() fixes

From: Bartlomiej Zolnierkiewicz
Date: Sun Feb 01 2009 - 14:15:22 EST


Check for ide_build_sglist() return value and re-map sg table if necessary.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@xxxxxxxxx>
---
drivers/ide/icside.c | 4 ++++
1 file changed, 4 insertions(+)

Index: b/drivers/ide/icside.c
===================================================================
--- a/drivers/ide/icside.c
+++ b/drivers/ide/icside.c
@@ -326,6 +326,10 @@ static int icside_dma_setup(ide_drive_t
BUG_ON(dma_channel_active(ec->dma));

hwif->sg_nents = ide_build_sglist(drive, rq);
+ if (hwif->sg_nents == 0) {
+ ide_map_sg(drive, rq);
+ return 1;
+ }

/*
* Ensure that we have the right interrupt routed.
--
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/