Skip to contentSkip to conversation

rbd: passing wrong variable to bvec_kunmap_irq()

PATCH New Dan Carpenter 1 participant 1 message Oct 11, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 rbd: passing wrong variable to bvec_kunmap_irq()

We should be passing "buf" here insead of "bv". This is tricky because it's not the same as kmap() and kunmap(). GCC does warn about it if you compile on i386 with CONFIG_HIGHMEM.

---
If it's any consolation, out of three callers to bvec_kunmap_irq() only one caller was correct. :P

drivers/block/rbd.c +1 -1
index 52f9420..6ec9d53 100644
@@ -554,7 +554,7 @@ static void zero_bio_chain(struct bio *chain, int start_ofs)
 				buf = bvec_kmap_irq(bv, &flags);
 				memset(buf + remainder, 0,
 				       bv->bv_len - remainder);
-				bvec_kunmap_irq(bv, &flags);
+				bvec_kunmap_irq(buf, &flags);
 			}
 			pos += bv->bv_len;
 		}