git: d538e52c515b - stable/13 - ctl ramdisk: Free compare buffer after a compare I/O request.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 29 Apr 2022 23:12:46 UTC
The branch stable/13 has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=d538e52c515b334a9e8f6b48abe08e03b8cdeafb
commit d538e52c515b334a9e8f6b48abe08e03b8cdeafb
Author: John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-02-18 23:20:14 +0000
Commit: John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-04-29 23:09:48 +0000
ctl ramdisk: Free compare buffer after a compare I/O request.
For a compare request, the ramdisk backend allocates a temporary
buffer to hold the I/O data and then compares it against the LUN's
pages in ctl_backend_ramdisk_cmp after the data has been filled.
However, the tempory buffer was leaked when after the comparison was
complete. Fix this by freeing the buffer after the comparison.
Reviewed by: mav
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D34316
(cherry picked from commit bd6e8729d6f6d42102b0359b56b7e3c89edd0ec9)
---
sys/cam/ctl/ctl_backend_ramdisk.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sys/cam/ctl/ctl_backend_ramdisk.c b/sys/cam/ctl/ctl_backend_ramdisk.c
index 6febdd469bdd..9ddee1814aa1 100644
--- a/sys/cam/ctl/ctl_backend_ramdisk.c
+++ b/sys/cam/ctl/ctl_backend_ramdisk.c
@@ -386,6 +386,7 @@ ctl_backend_ramdisk_cmp(union ctl_io *io)
if (res < cbe_lun->blocksize)
break;
}
+ free(io->scsiio.kern_data_ptr, M_RAMDISK);
if (lbas > 0) {
off += io->scsiio.kern_rel_offset - io->scsiio.kern_data_len;
scsi_u64to8b(off, info);