diff options
author | Moore, Eric <Eric.Moore@lsil.com> | 2006-01-17 19:06:23 -0500 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2006-01-31 15:40:03 -0500 |
commit | 335a94124470dd5be6c42378d1b7f7af9a80919e (patch) | |
tree | 1737368059803a88caf0367800593e392ab46777 /drivers/message/fusion/mptbase.c | |
parent | 23f236ed2748fca0bcba304f4f9e3eacda51e91c (diff) |
[SCSI] fusion: unloading the driver results in panic - fix
The ioc->alt_ioc->alt_ioc pointer is not getting cleared
during driver unload time. This dangling pointer
can result in panic in certain circumstances, such
as error recovery, or firmware download in flashless
environments. This only impacts dual functions controllers,
such as 1030. Please apply.
This patch also includes a small cosmetic name change
for mpt_spi_log_info.
Signed-off-by: Eric Moore <Eric.Moore@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/message/fusion/mptbase.c')
-rw-r--r-- | drivers/message/fusion/mptbase.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index e352b000c7d1..9a2c7605d49c 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c | |||
@@ -178,7 +178,7 @@ static void mpt_get_fw_exp_ver(char *buf, MPT_ADAPTER *ioc); | |||
178 | static int ProcessEventNotification(MPT_ADAPTER *ioc, EventNotificationReply_t *evReply, int *evHandlers); | 178 | static int ProcessEventNotification(MPT_ADAPTER *ioc, EventNotificationReply_t *evReply, int *evHandlers); |
179 | static void mpt_sp_ioc_info(MPT_ADAPTER *ioc, u32 ioc_status, MPT_FRAME_HDR *mf); | 179 | static void mpt_sp_ioc_info(MPT_ADAPTER *ioc, u32 ioc_status, MPT_FRAME_HDR *mf); |
180 | static void mpt_fc_log_info(MPT_ADAPTER *ioc, u32 log_info); | 180 | static void mpt_fc_log_info(MPT_ADAPTER *ioc, u32 log_info); |
181 | static void mpt_sp_log_info(MPT_ADAPTER *ioc, u32 log_info); | 181 | static void mpt_spi_log_info(MPT_ADAPTER *ioc, u32 log_info); |
182 | static void mpt_sas_log_info(MPT_ADAPTER *ioc, u32 log_info); | 182 | static void mpt_sas_log_info(MPT_ADAPTER *ioc, u32 log_info); |
183 | 183 | ||
184 | /* module entry point */ | 184 | /* module entry point */ |
@@ -317,7 +317,7 @@ mpt_reply(MPT_ADAPTER *ioc, u32 pa) | |||
317 | if (ioc->bus_type == FC) | 317 | if (ioc->bus_type == FC) |
318 | mpt_fc_log_info(ioc, log_info); | 318 | mpt_fc_log_info(ioc, log_info); |
319 | else if (ioc->bus_type == SPI) | 319 | else if (ioc->bus_type == SPI) |
320 | mpt_sp_log_info(ioc, log_info); | 320 | mpt_spi_log_info(ioc, log_info); |
321 | else if (ioc->bus_type == SAS) | 321 | else if (ioc->bus_type == SAS) |
322 | mpt_sas_log_info(ioc, log_info); | 322 | mpt_sas_log_info(ioc, log_info); |
323 | } | 323 | } |
@@ -1492,6 +1492,8 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1492 | free_irq(ioc->pci_irq, ioc); | 1492 | free_irq(ioc->pci_irq, ioc); |
1493 | if (mpt_msi_enable) | 1493 | if (mpt_msi_enable) |
1494 | pci_disable_msi(pdev); | 1494 | pci_disable_msi(pdev); |
1495 | if (ioc->alt_ioc) | ||
1496 | ioc->alt_ioc->alt_ioc = NULL; | ||
1495 | iounmap(mem); | 1497 | iounmap(mem); |
1496 | kfree(ioc); | 1498 | kfree(ioc); |
1497 | pci_set_drvdata(pdev, NULL); | 1499 | pci_set_drvdata(pdev, NULL); |
@@ -2168,6 +2170,10 @@ mpt_adapter_dispose(MPT_ADAPTER *ioc) | |||
2168 | sz_last = ioc->alloc_total; | 2170 | sz_last = ioc->alloc_total; |
2169 | dprintk((KERN_INFO MYNAM ": %s: free'd %d of %d bytes\n", | 2171 | dprintk((KERN_INFO MYNAM ": %s: free'd %d of %d bytes\n", |
2170 | ioc->name, sz_first-sz_last+(int)sizeof(*ioc), sz_first)); | 2172 | ioc->name, sz_first-sz_last+(int)sizeof(*ioc), sz_first)); |
2173 | |||
2174 | if (ioc->alt_ioc) | ||
2175 | ioc->alt_ioc->alt_ioc = NULL; | ||
2176 | |||
2171 | kfree(ioc); | 2177 | kfree(ioc); |
2172 | } | 2178 | } |
2173 | 2179 | ||
@@ -6204,7 +6210,7 @@ mpt_fc_log_info(MPT_ADAPTER *ioc, u32 log_info) | |||
6204 | 6210 | ||
6205 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 6211 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
6206 | /* | 6212 | /* |
6207 | * mpt_sp_log_info - Log information returned from SCSI Parallel IOC. | 6213 | * mpt_spi_log_info - Log information returned from SCSI Parallel IOC. |
6208 | * @ioc: Pointer to MPT_ADAPTER structure | 6214 | * @ioc: Pointer to MPT_ADAPTER structure |
6209 | * @mr: Pointer to MPT reply frame | 6215 | * @mr: Pointer to MPT reply frame |
6210 | * @log_info: U32 LogInfo word from the IOC | 6216 | * @log_info: U32 LogInfo word from the IOC |
@@ -6212,7 +6218,7 @@ mpt_fc_log_info(MPT_ADAPTER *ioc, u32 log_info) | |||
6212 | * Refer to lsi/sp_log.h. | 6218 | * Refer to lsi/sp_log.h. |
6213 | */ | 6219 | */ |
6214 | static void | 6220 | static void |
6215 | mpt_sp_log_info(MPT_ADAPTER *ioc, u32 log_info) | 6221 | mpt_spi_log_info(MPT_ADAPTER *ioc, u32 log_info) |
6216 | { | 6222 | { |
6217 | u32 info = log_info & 0x00FF0000; | 6223 | u32 info = log_info & 0x00FF0000; |
6218 | char *desc = "unknown"; | 6224 | char *desc = "unknown"; |