From 37eb06f8584d6b7557ad802a458855ac775a8d65 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Wed, 11 Sep 2002 16:37:33 +0200 Subject: ide_map_buffer() and ide_unmap_buffer() could cause imbalanced calls to bio_kmap/kunmap_irq(), which would screw the preemption count. pass in rq to ide_unmap_buffer() as well to make the right decision. --- include/linux/ide.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include/linux') diff --git a/include/linux/ide.h b/include/linux/ide.h index 32409745ded5..c9064eff5996 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -894,9 +894,10 @@ extern inline void *ide_map_buffer(struct request *rq, unsigned long *flags) return rq->buffer + task_rq_offset(rq); } -extern inline void ide_unmap_buffer(char *buffer, unsigned long *flags) +extern inline void ide_unmap_buffer(struct request *rq, char *buffer, unsigned long *flags) { - bio_kunmap_irq(buffer, flags); + if (rq->bio) + bio_kunmap_irq(buffer, flags); } #define IDE_CHIPSET_PCI_MASK \ -- cgit v1.2.3