public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <mikenc@us.ibm.com>
To: James.Smart@Emulex.Com
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH 2/2  scsi-rc-fixes-2.6] FC Remote Port patch
Date: Wed, 09 Feb 2005 00:15:43 -0800	[thread overview]
Message-ID: <4209C6AF.4050303@us.ibm.com> (raw)
In-Reply-To: <0B1E13B586976742A7599D71A6AC733C12EB47@xbl3.ma.emulex.com>


+static void
+fc_rport_terminate(struct fc_rport  *rport)
+{
+	struct Scsi_Host *shost = rport_to_shost(rport);
+	struct device *dev = &rport->dev;
+	unsigned long flags;
+
+	if (rport->starget) {
+		scsi_forget_target(rport->starget);
+		__scsi_remove_target(rport->starget);
+	}
+
+	transport_remove_device(dev);
+	device_del(dev);
+	transport_destroy_device(dev);
+	spin_lock_irqsave(shost->host_lock, flags);
+	list_del(&rport->peers);
+	spin_unlock_irqrestore(shost->host_lock, flags);
+	put_device(&shost->shost_gendev);
+
+	kfree(rport);
  }

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?


  reply	other threads:[~2005-02-09  8:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-09  4:18 [PATCH 2/2 scsi-rc-fixes-2.6] FC Remote Port patch James.Smart
2005-02-09  8:15 ` Mike Christie [this message]
2005-02-09 18:09 ` Christoph Hellwig
2005-02-09 18:32 ` Andrew Vasquez
  -- strict thread matches above, loose matches on Subject: below --
2005-02-09 18:07 James.Smart
2005-02-09 19:24 James.Smart
2005-02-09 23:03 ` Andrew Vasquez
2005-02-10 18:56   ` Andrew Vasquez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4209C6AF.4050303@us.ibm.com \
    --to=mikenc@us.ibm.com \
    --cc=James.Smart@Emulex.Com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox