Skip to content

Commit a75ca93

Browse files
YuKuai-huaweiaxboe
authored andcommitted
block/bio-integrity: don't free 'buf' if bio_integrity_add_page() failed
commit e7bf90e ("block/bio-integrity: fix a memory leak bug") added a kfree() for 'buf' if bio_integrity_add_page() returns '0'. However, the object will be freed in bio_integrity_free() since 'bio->bi_opf' and 'bio->bi_integrity' were set previousy in bio_integrity_alloc(). Fixes: commit e7bf90e ("block/bio-integrity: fix a memory leak bug") Signed-off-by: yu kuai <[email protected]> Reviewed-by: Ming Lei <[email protected]> Reviewed-by: Bob Liu <[email protected]> Acked-by: Martin K. Petersen <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 1ee08de commit a75ca93

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

block/bio-integrity.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,6 @@ bool bio_integrity_prep(struct bio *bio)
281281

282282
if (ret == 0) {
283283
printk(KERN_ERR "could not attach integrity payload\n");
284-
kfree(buf);
285284
status = BLK_STS_RESOURCE;
286285
goto err_end_io;
287286
}

0 commit comments

Comments
 (0)