Commit 7b6c0f80 authored by Dan Carpenter's avatar Dan Carpenter Committed by Jens Axboe

blk-integrity: checking for NULL instead of IS_ERR

We recently changed bio_integrity_alloc() to return ERR_PTRs instead of
NULL but these calls were missed.

Fixes: 06c1e390 ('blk-integrity: empty implementation when disabled')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent d1ea7be5
...@@ -298,10 +298,10 @@ int bio_integrity_prep(struct bio *bio) ...@@ -298,10 +298,10 @@ int bio_integrity_prep(struct bio *bio)
/* Allocate bio integrity payload and integrity vectors */ /* Allocate bio integrity payload and integrity vectors */
bip = bio_integrity_alloc(bio, GFP_NOIO, nr_pages); bip = bio_integrity_alloc(bio, GFP_NOIO, nr_pages);
if (unlikely(bip == NULL)) { if (IS_ERR(bip)) {
printk(KERN_ERR "could not allocate data integrity bioset\n"); printk(KERN_ERR "could not allocate data integrity bioset\n");
kfree(buf); kfree(buf);
return -EIO; return PTR_ERR(bip);
} }
bip->bip_flags |= BIP_BLOCK_INTEGRITY; bip->bip_flags |= BIP_BLOCK_INTEGRITY;
...@@ -465,9 +465,8 @@ int bio_integrity_clone(struct bio *bio, struct bio *bio_src, ...@@ -465,9 +465,8 @@ int bio_integrity_clone(struct bio *bio, struct bio *bio_src,
BUG_ON(bip_src == NULL); BUG_ON(bip_src == NULL);
bip = bio_integrity_alloc(bio, gfp_mask, bip_src->bip_vcnt); bip = bio_integrity_alloc(bio, gfp_mask, bip_src->bip_vcnt);
if (IS_ERR(bip))
if (bip == NULL) return PTR_ERR(bip);
return -EIO;
memcpy(bip->bip_vec, bip_src->bip_vec, memcpy(bip->bip_vec, bip_src->bip_vec,
bip_src->bip_vcnt * sizeof(struct bio_vec)); bip_src->bip_vcnt * sizeof(struct bio_vec));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment