Date: Fri, 18 Feb 2022 23:21:06 GMT From: John Baldwin <jhb@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: bd6e8729d6f6 - main - ctl ramdisk: Free compare buffer after a compare I/O request. Message-ID: <202202182321.21INL62T061018@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=bd6e8729d6f6d42102b0359b56b7e3c89edd0ec9 commit bd6e8729d6f6d42102b0359b56b7e3c89edd0ec9 Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2022-02-18 23:20:14 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2022-02-18 23:20:14 +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 --- 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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202202182321.21INL62T061018>