Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754684AbbLIK0f (ORCPT ); Wed, 9 Dec 2015 05:26:35 -0500 Received: from mx2.suse.de ([195.135.220.15]:37317 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754481AbbLIK0a (ORCPT ); Wed, 9 Dec 2015 05:26:30 -0500 Message-ID: <1449656787.3311.25.camel@suse.de> Subject: Re: [patch] blk-integrity: checking for NULL instead of IS_ERR From: Johannes Thumshirn To: Dan Carpenter , Jens Axboe , Keith Busch Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Date: Wed, 09 Dec 2015 11:26:27 +0100 In-Reply-To: <20151209102123.GA3173@mwanda> References: <20151209102123.GA3173@mwanda> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.18.2 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1790 Lines: 50 On Wed, 2015-12-09 at 13:21 +0300, Dan Carpenter wrote: > 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 > > diff --git a/block/bio-integrity.c b/block/bio-integrity.c > index e6ba501..711e4d8d 100644 > --- a/block/bio-integrity.c > +++ b/block/bio-integrity.c > @@ -298,10 +298,10 @@ int bio_integrity_prep(struct bio *bio) >   >   /* Allocate bio integrity payload and integrity vectors */ >   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"); >   kfree(buf); > - return -EIO; > + return PTR_ERR(bip); >   } >   >   bip->bip_flags |= BIP_BLOCK_INTEGRITY; > @@ -465,9 +465,8 @@ int bio_integrity_clone(struct bio *bio, struct bio > *bio_src, >   BUG_ON(bip_src == NULL); >   >   bip = bio_integrity_alloc(bio, gfp_mask, bip_src->bip_vcnt); > - > - if (bip == NULL) > - return -EIO; > + if (IS_ERR(bip)) > + return PTR_ERR(bip); >   >   memcpy(bip->bip_vec, bip_src->bip_vec, >          bip_src->bip_vcnt * sizeof(struct bio_vec)); > -- > To unsubscribe from this list: send the line "unsubscribe linux-block" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at  http://vger.kernel.org/majordomo-info.html Reviewed-by: Johannes Thumshirn -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/