> Do you want to free the memory in the struct device's release
> function like the scsi_device's release function? If userspace
> has a sysfs file open and is reading or writing to it at the
> same time you free the memory here, will fun things happen?

Yep...

Here's a small patch to correct for this...

-- James S



diff -puN a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
--- a/drivers/scsi/scsi_transport_fc.c  2005-02-09 09:04:32.000000000 -0500
+++ b/drivers/scsi/scsi_transport_fc.c  2005-02-09 09:06:33.000000000 -0500
@@ -984,7 +984,9 @@ static int fc_target_match(struct attrib
 
 static void fc_rport_dev_release(struct device *dev)
 {
+       struct fc_rport *rport = dev_to_rport(dev);
        put_device(dev->parent);
+       kfree(rport);
 }
 
 int scsi_is_fc_rport(const struct device *dev)
@@ -1410,8 +1412,6 @@ fc_rport_terminate(struct fc_rport  *rpo
        list_del(&rport->peers);
        spin_unlock_irqrestore(shost->host_lock, flags);
        put_device(&shost->shost_gendev);
-
-       kfree(rport);
 }
 
 /**
_
-
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