aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp
diff options
context:
space:
mode:
authorRoland Dreier <rolandd@cisco.com>2008-10-10 18:58:52 -0400
committerRoland Dreier <rolandd@cisco.com>2008-10-10 18:58:52 -0400
commit2767840a5ca73fde62b25e0209aa9269ec4fa7c7 (patch)
treeffa319b849854af05f1b8a0e46191386ab6cec4a /drivers/infiniband/ulp
parentf6bccf695431da0e9bd773550ae91b8cb9ffb227 (diff)
IPoIB: Always initialize poll_timer to avoid crash on unload
ipoib_ib_dev_stop() does del_timer_sync(&priv->poll_timer), but if a P_key for an interface is not found, poll_timer is not initialized, so this leads to a crash or hang. Fix this by moving where poll_timer is initialized to ipoib_ib_dev_init(), which is always called. This fixes <https://bugs.openfabrics.org/show_bug.cgi?id=1172>. Debugged-by: Yosef Etigin <yosefe@voltaire.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/ulp')
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_ib.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
index 0e748aeeae99..28eb6f03c588 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
@@ -685,10 +685,6 @@ int ipoib_ib_dev_open(struct net_device *dev)
685 queue_delayed_work(ipoib_workqueue, &priv->ah_reap_task, 685 queue_delayed_work(ipoib_workqueue, &priv->ah_reap_task,
686 round_jiffies_relative(HZ)); 686 round_jiffies_relative(HZ));
687 687
688 init_timer(&priv->poll_timer);
689 priv->poll_timer.function = ipoib_ib_tx_timer_func;
690 priv->poll_timer.data = (unsigned long)dev;
691
692 set_bit(IPOIB_FLAG_INITIALIZED, &priv->flags); 688 set_bit(IPOIB_FLAG_INITIALIZED, &priv->flags);
693 689
694 return 0; 690 return 0;
@@ -906,6 +902,9 @@ int ipoib_ib_dev_init(struct net_device *dev, struct ib_device *ca, int port)
906 return -ENODEV; 902 return -ENODEV;
907 } 903 }
908 904
905 setup_timer(&priv->poll_timer, ipoib_ib_tx_timer_func,
906 (unsigned long) dev);
907
909 if (dev->flags & IFF_UP) { 908 if (dev->flags & IFF_UP) {
910 if (ipoib_ib_dev_open(dev)) { 909 if (ipoib_ib_dev_open(dev)) {
911 ipoib_transport_dev_cleanup(dev); 910 ipoib_transport_dev_cleanup(dev);