From 13c644901617ac8fa8df546fc2b31c0ecb459f37 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 9 Sep 2021 03:22:31 +0000 Subject: [PATCH] scst_vdisk: Fix bio_integrity_alloc() error checking In 2015 bio_integrity_alloc() was modified such that it returns an error pointer instead of NULL upon failure. Hence this patch. See also upstream commit 06c1e3902aa7 ("blk-integrity: empty implementation when disabled"; v4.5). git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9576 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/dev_handlers/scst_vdisk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index 4522c8fb3..b2137e67a 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -5933,7 +5933,7 @@ static void vdisk_blk_add_dif(struct bio *bio, gfp_t gfp_mask, } bip = bio_integrity_alloc(bio, gfp_mask, pages); - if (unlikely(bip == NULL)) { + if (unlikely(IS_ERR_OR_NULL(bip))) { PRINT_WARNING("Allocation of %d pages for DIF tags " "failed! (dev %s)", pages, dev->virt_name); goto out; /* proceed without integrity */