Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Apr 2022 23:12:46 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: d538e52c515b - stable/13 - ctl ramdisk: Free compare buffer after a compare I/O request.
Message-ID:  <202204292312.23TNCkmQ045098@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202204292312.23TNCkmQ045098>