James:

When I posted a patch last week to fix a reference to deallocated memory 
in sd.c, I forgot to check whether the same problem exists in sr.c.  It 
does, and here's the patch to fix it.

Alan Stern



Signed-off-by: Alan Stern <[EMAIL PROTECTED]>

===== drivers/scsi/sr.c 1.78 vs edited =====
--- 1.78/drivers/scsi/sr.c      2005-01-11 11:57:28 -05:00
+++ edited/drivers/scsi/sr.c    2005-01-18 09:53:50 -05:00
@@ -152,9 +152,11 @@
 
 static inline void scsi_cd_put(struct scsi_cd *cd)
 {
+       struct scsi_device *sdev = cd->device;
+
        down(&sr_ref_sem);
        kref_put(&cd->kref, sr_kref_release);
-       scsi_device_put(cd->device);
+       scsi_device_put(sdev);
        up(&sr_ref_sem);
 }
 

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to