Commit 6e59c939 authored by James Bottomley's avatar James Bottomley

SCSI: fix HBA removal problem with transport classes

James Smart pointed out that if you insert and remove a HBA driver a few
times, eventually the system oopses.

The reason is that the transport classes all kfree their attribute
containers, but don't actually unregister them first (so we have freed
memory on the container list).  The attached should fix this.
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 5e16e182
......@@ -847,6 +847,9 @@ void fc_release_transport(struct scsi_transport_template *t)
{
struct fc_internal *i = to_fc_internal(t);
attribute_container_unregister(&i->t.target_attrs);
attribute_container_unregister(&i->t.host_attrs);
kfree(i);
}
EXPORT_SYMBOL(fc_release_transport);
......
......@@ -356,6 +356,10 @@ EXPORT_SYMBOL(iscsi_attach_transport);
void iscsi_release_transport(struct scsi_transport_template *t)
{
struct iscsi_internal *i = to_iscsi_internal(t);
attribute_container_unregister(&i->t.target_attrs);
attribute_container_unregister(&i->t.host_attrs);
kfree(i);
}
......
......@@ -921,6 +921,9 @@ void spi_release_transport(struct scsi_transport_template *t)
{
struct spi_internal *i = to_spi_internal(t);
attribute_container_unregister(&i->t.target_attrs);
attribute_container_unregister(&i->t.host_attrs);
kfree(i);
}
EXPORT_SYMBOL(spi_release_transport);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment