RDMA/nes: fix hazard of sending ibevent for unregistered device
PATCH 1/1 RDMA/nes: fix hazard of sending ibevent for unregistered device
nes_port_ibevent() should not be called when nes IB device is not registered with IB core.
Add missing checks of of_device_registered flag.
---
drivers/infiniband/hw/nes/nes_hw.c | 32 ++++++++++++++++++++------------ 1 files changed, 20 insertions(+), 12 deletions(-)
drivers/infiniband/hw/nes/nes_hw.c +20 -12
@@ -2610,9 +2610,11 @@ static void nes_process_mac_intr(structnetif_carrier_on (nesvnic->netdev);spin_lock (&nesvnic->port_ibevent_lock); -if (nesdev->iw_status ==0 ) { - nesdev->iw_status =1 ; -nes_port_ibevent (nesvnic); +if (nesvnic->of_device_registered) { +if (nesdev->iw_status ==0 ) { + nesdev->iw_status =1 ; +nes_port_ibevent (nesvnic); + } }spin_unlock (&nesvnic->port_ibevent_lock); }
@@ -2642,9 +2644,11 @@ static void nes_process_mac_intr(structnetif_carrier_off (nesvnic->netdev);spin_lock (&nesvnic->port_ibevent_lock); -if (nesdev->iw_status ==1 ) { - nesdev->iw_status =0 ; -nes_port_ibevent (nesvnic); +if (nesvnic->of_device_registered) { +if (nesdev->iw_status ==1 ) { + nesdev->iw_status =0 ; +nes_port_ibevent (nesvnic); + } }spin_unlock (&nesvnic->port_ibevent_lock); }
@@ -2703,9 +2707,11 @@ void nes_recheck_link_status(struct worknetif_carrier_on (nesvnic->netdev);spin_lock (&nesvnic->port_ibevent_lock); -if (nesdev->iw_status ==0 ) { - nesdev->iw_status =1 ; -nes_port_ibevent (nesvnic); +if (nesvnic->of_device_registered) { +if (nesdev->iw_status ==0 ) { + nesdev->iw_status =1 ; +nes_port_ibevent (nesvnic); + } }spin_unlock (&nesvnic->port_ibevent_lock); }
@@ -2723,9 +2729,11 @@ void nes_recheck_link_status(struct worknetif_carrier_off (nesvnic->netdev);spin_lock (&nesvnic->port_ibevent_lock); -if (nesdev->iw_status ==1 ) { - nesdev->iw_status =0 ; -nes_port_ibevent (nesvnic); +if (nesvnic->of_device_registered) { +if (nesdev->iw_status ==1 ) { + nesdev->iw_status =0 ; +nes_port_ibevent (nesvnic); + } }spin_unlock (&nesvnic->port_ibevent_lock); }
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20110125134916.6532.63603.stgit-YbU/[email protected]
Quoted 3 lines
nes_port_ibevent()should not be called when nes IB device is not registered with IB core.
Add missing checks ofof_device_registeredflag.
Thanks, applied.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html