aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVitaliy Gusev <vgusev@openvz.org>2009-09-16 03:00:21 -0400
committerDavid S. Miller <davem@davemloft.net>2009-09-16 03:00:21 -0400
commit634354d753898f9d9d146bd47628a1ef27f7dc98 (patch)
tree741559fce26417a710bd04e7a704e635d7864e53
parent657e9649e745b06675aa5063c84430986cdc3afa (diff)
mlx4: Fix access to freed memory
catas_reset() uses pointer to mlx4_priv, but mlx4_priv is not valid after call mlx4_restart_one(). Signed-off-by: Vitaliy Gusev <vgusev@openvz.org> Acked-by: Roland Dreier <rolandd@cisco.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/mlx4/catas.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/net/mlx4/catas.c b/drivers/net/mlx4/catas.c
index aa9674b7f19c..f599294fa8ab 100644
--- a/drivers/net/mlx4/catas.c
+++ b/drivers/net/mlx4/catas.c
@@ -96,12 +96,17 @@ static void catas_reset(struct work_struct *work)
96 spin_unlock_irq(&catas_lock); 96 spin_unlock_irq(&catas_lock);
97 97
98 list_for_each_entry_safe(priv, tmppriv, &tlist, catas_err.list) { 98 list_for_each_entry_safe(priv, tmppriv, &tlist, catas_err.list) {
99 struct pci_dev *pdev = priv->dev.pdev;
100
99 ret = mlx4_restart_one(priv->dev.pdev); 101 ret = mlx4_restart_one(priv->dev.pdev);
100 dev = &priv->dev; 102 /* 'priv' now is not valid */
101 if (ret) 103 if (ret)
102 mlx4_err(dev, "Reset failed (%d)\n", ret); 104 printk(KERN_ERR "mlx4 %s: Reset failed (%d)\n",
103 else 105 pci_name(pdev), ret);
106 else {
107 dev = pci_get_drvdata(pdev);
104 mlx4_dbg(dev, "Reset succeeded\n"); 108 mlx4_dbg(dev, "Reset succeeded\n");
109 }
105 } 110 }
106} 111}
107 112