aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2009-03-04 04:53:02 -0500
committerDavid S. Miller <davem@davemloft.net>2009-03-04 20:40:22 -0500
commit8c870379d2db81a11ede65e9fd9774e4e6efe84a (patch)
tree108e0a64e644c6d33ef7f2b4ea06488d8a2c57c6 /drivers/net/sfc
parent115122afc5e34499a0edfd2b057e9c352fa7c78f (diff)
sfc: Clear I2C adapter structure in falcon_remove_nic()
i2c_del_adapter() leaves dangling pointers in the structure. If we retry the NIC probe and pass the structure to i2c_add_adapter() again it will lead to an oops unless we clear it first. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc')
-rw-r--r--drivers/net/sfc/falcon.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c
index 9e2f0f0d47a8..efd121c42a21 100644
--- a/drivers/net/sfc/falcon.c
+++ b/drivers/net/sfc/falcon.c
@@ -3114,8 +3114,10 @@ void falcon_remove_nic(struct efx_nic *efx)
3114 struct falcon_nic_data *nic_data = efx->nic_data; 3114 struct falcon_nic_data *nic_data = efx->nic_data;
3115 int rc; 3115 int rc;
3116 3116
3117 /* Remove I2C adapter and clear it in preparation for a retry */
3117 rc = i2c_del_adapter(&efx->i2c_adap); 3118 rc = i2c_del_adapter(&efx->i2c_adap);
3118 BUG_ON(rc); 3119 BUG_ON(rc);
3120 memset(&efx->i2c_adap, 0, sizeof(efx->i2c_adap));
3119 3121
3120 falcon_remove_spi_devices(efx); 3122 falcon_remove_spi_devices(efx);
3121 falcon_free_buffer(efx, &efx->irq_status); 3123 falcon_free_buffer(efx, &efx->irq_status);