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 <martin.petersen@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Martin K. Petersen 2008-07-16 16:09:06 -04:00 committed by Linus Torvalds
parent 8df1b049bc
commit d442cc44c0
1 changed files with 3 additions and 0 deletions

View File

@ -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);
}