Skip to contentSkip to conversation

status of patch to fix memory leak in scan_scsis_single

PATCH Jamie Wellnitz 1 participant 1 message Oct 9, 2003 SCSI

lore
Share & tools
lore
#0 lore raw

There appears to be a memory leak in the scan_scsis_single function in 2.4.23pre6: the scsi_release_commandblocks function is not called in a couple of cases where scan_scsis_single returns early. (This memory was allocated by scsi_build_commandblocks.)

I found this patch:

scsi_scan.c.mine 2003-01-17 11:53:03.000000000 -0700 renamed from scsi_scan.c 2003-01-17 11:53:07.000000000 -0700 +2 -0
@@ -596,6 +596,7 @@
                } else {
                        /* assume no peripheral if any other sort of error */
                        scsi_release_request(SRpnt);
+                       scsi_release_commandblocks(SDpnt);
                        return 0;
                }
        }
@@ -619,6 +620,7 @@
         */
        if ((scsi_result[0] >> 5) == 3) {
                scsi_release_request(SRpnt);
+               scsi_release_commandblocks(SDpnt);
                return 0;       /* assume no peripheral if any sort of error */
        }
         /*   The Toshiba ROM was "gender-changed" here as an inline hack.

(full message here:
http://marc.theaimsgroup.com/?l=linux-scsi&m=104282995014242&w=2
)

... posted to linux-scsi back in January, but this change doesn't appear to be in 2.4.23pre6. (The first block does seem to have been applied to Red Hat's recent kernels.)

Is there something wrong with this patch or is it pending for 2.4.twentysomething?

Thanks,
Jamie Wellnitz
[email protected]