From: Martin K. Petersen Date: Wed, 16 Jul 2008 20:09:06 +0000 (-0400) Subject: block: Trivial fix for blk_integrity_rq() X-Git-Tag: v2.6.27-rc1~1051 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d442cc44c0db56e84ef6aa244a88427d2efe06cd;p=linux-2.6 block: Trivial fix for blk_integrity_rq() Fail integrity check gracefully when request does not have a bio attached (BLOCK_PC). Signed-off-by: Martin K. Petersen Signed-off-by: Linus Torvalds --- diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 32a441b05f..88d68081a0 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -985,6 +985,9 @@ static inline int bdev_integrity_enabled(struct block_device *bdev, int rw) static inline int blk_integrity_rq(struct request *rq) { + if (rq->bio == NULL) + return 0; + return bio_integrity(rq->bio); }