]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
hippi: Fix a size used in a 'pci_free_consistent()' in an error handling path
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Tue, 14 Jul 2020 11:00:27 +0000 (13:00 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 Jul 2020 14:43:13 +0000 (16:43 +0200)
[ Upstream commit 3195c4706b00106aa82c73acd28340fa8fc2bfc1 ]

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: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/hippi/rrunner.c

index 313e006f74feb987f1120897a48fabada86b9a69..6f3519123eb66fc47521a693e430940fecc09af7 100644 (file)
@@ -1250,7 +1250,7 @@ static int rr_open(struct net_device *dev)
                rrpriv->info = NULL;
        }
        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 = NULL;
        }