aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2015-12-09 05:21:23 -0500
committerJens Axboe <axboe@fb.com>2015-12-09 10:04:29 -0500
commit7b6c0f8034d78390f9185e2ec2edb0a3e4ad244e (patch)
tree18e857e72e4dcbd7969ef68d7086b3375e10e6d0 /block
parentd1ea7be5f755bf1a4d4fdccc35880fcf5069df60 (diff)
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: 06c1e3902aa7 ('blk-integrity: empty implementation when disabled') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block')
-rw-r--r--block/bio-integrity.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/block/bio-integrity.c b/block/bio-integrity.c
index e6ba501eb746..711e4d8de6fa 100644
--- a/block/bio-integrity.c
+++ b/block/bio-integrity.c
@@ -298,10 +298,10 @@ int bio_integrity_prep(struct bio *bio)
298 298
299 /* Allocate bio integrity payload and integrity vectors */ 299 /* Allocate bio integrity payload and integrity vectors */
300 bip = bio_integrity_alloc(bio, GFP_NOIO, nr_pages); 300 bip = bio_integrity_alloc(bio, GFP_NOIO, nr_pages);
301 if (unlikely(bip == NULL)) { 301 if (IS_ERR(bip)) {
302 printk(KERN_ERR "could not allocate data integrity bioset\n"); 302 printk(KERN_ERR "could not allocate data integrity bioset\n");
303 kfree(buf); 303 kfree(buf);
304 return -EIO; 304 return PTR_ERR(bip);
305 } 305 }
306 306
307 bip->bip_flags |= BIP_BLOCK_INTEGRITY; 307 bip->bip_flags |= BIP_BLOCK_INTEGRITY;
@@ -465,9 +465,8 @@ int bio_integrity_clone(struct bio *bio, struct bio *bio_src,
465 BUG_ON(bip_src == NULL); 465 BUG_ON(bip_src == NULL);
466 466
467 bip = bio_integrity_alloc(bio, gfp_mask, bip_src->bip_vcnt); 467 bip = bio_integrity_alloc(bio, gfp_mask, bip_src->bip_vcnt);
468 468 if (IS_ERR(bip))
469 if (bip == NULL) 469 return PTR_ERR(bip);
470 return -EIO;
471 470
472 memcpy(bip->bip_vec, bip_src->bip_vec, 471 memcpy(bip->bip_vec, bip_src->bip_vec,
473 bip_src->bip_vcnt * sizeof(struct bio_vec)); 472 bip_src->bip_vcnt * sizeof(struct bio_vec));