dect
/
linux-2.6
Archived
13
0
Fork 0

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>
This commit is contained in:
Vitaliy Gusev 2009-09-16 00:00:21 -07:00 committed by David S. Miller
parent 657e9649e7
commit 634354d753
1 changed files with 8 additions and 3 deletions

View File

@ -96,12 +96,17 @@ static void catas_reset(struct work_struct *work)
spin_unlock_irq(&catas_lock);
list_for_each_entry_safe(priv, tmppriv, &tlist, catas_err.list) {
struct pci_dev *pdev = priv->dev.pdev;
ret = mlx4_restart_one(priv->dev.pdev);
dev = &priv->dev;
/* 'priv' now is not valid */
if (ret)
mlx4_err(dev, "Reset failed (%d)\n", ret);
else
printk(KERN_ERR "mlx4 %s: Reset failed (%d)\n",
pci_name(pdev), ret);
else {
dev = pci_get_drvdata(pdev);
mlx4_dbg(dev, "Reset succeeded\n");
}
}
}