Commit 1368e055 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Khalid Elmously

hippi: Fix a size used in a 'pci_free_consistent()' in an error handling path

BugLink: https://bugs.launchpad.net/bugs/1889928

[ Upstream commit 3195c470 ]

The size used when calling 'pci_alloc_consistent()' and
'pci_free_consistent()' should match.

Fix it and have it consistent with the corresponding call in 'rr_close()'.

Fixes: 1da177e4 ("Linux-2.6.12-rc2")
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent 7d75612d
...@@ -1250,7 +1250,7 @@ static int rr_open(struct net_device *dev) ...@@ -1250,7 +1250,7 @@ static int rr_open(struct net_device *dev)
rrpriv->info = NULL; rrpriv->info = NULL;
} }
if (rrpriv->rx_ctrl) { if (rrpriv->rx_ctrl) {
pci_free_consistent(pdev, sizeof(struct ring_ctrl), pci_free_consistent(pdev, 256 * sizeof(struct ring_ctrl),
rrpriv->rx_ctrl, rrpriv->rx_ctrl_dma); rrpriv->rx_ctrl, rrpriv->rx_ctrl_dma);
rrpriv->rx_ctrl = NULL; rrpriv->rx_ctrl = NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment