On 8/30/24 1:42 PM, Keith Busch wrote:
> From: Keith Busch <kbu...@kernel.org>
>
> bip is NULL before bio_integrity_prep().
>
> Signed-off-by: Keith Busch <kbu...@kernel.org>
Reviewed-by: Dave Jiang <dave.ji...@intel.com>
> ---
> drivers/nvdimm/btt.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c
> index 423dcd1909061..13594fb712186 100644
> --- a/drivers/nvdimm/btt.c
> +++ b/drivers/nvdimm/btt.c
> @@ -1435,8 +1435,8 @@ static int btt_do_bvec(struct btt *btt, struct
> bio_integrity_payload *bip,
>
> static void btt_submit_bio(struct bio *bio)
> {
> - struct bio_integrity_payload *bip = bio_integrity(bio);
> struct btt *btt = bio->bi_bdev->bd_disk->private_data;
> + struct bio_integrity_payload *bip;
> struct bvec_iter iter;
> unsigned long start;
> struct bio_vec bvec;
> @@ -1445,6 +1445,7 @@ static void btt_submit_bio(struct bio *bio)
>
> if (!bio_integrity_prep(bio))
> return;
> + bip = bio_integrity(bio);
>
> do_acct = blk_queue_io_stat(bio->bi_bdev->bd_disk->queue);
> if (do_acct)