diff options
author | Francois Romieu <romieu@fr.zoreil.com> | 2006-02-27 17:11:08 -0500 |
---|---|---|
committer | Francois Romieu <romieu@fr.zoreil.com> | 2006-02-27 17:11:08 -0500 |
commit | b3c3e7d7d9795df16012d5c60e5f789e7fade311 (patch) | |
tree | 7ad463d353263e765b302060da884a2eefb24173 /drivers/net/via-velocity.c | |
parent | de5f503cfbe4f942492269c6bd97a16a4d61e488 (diff) |
via-velocity: fix memory corruption when changing the mtu
velocity_rx_refill() only replenishes the descriptor entries which
belong to the CPU. It works great in the Rx path but the driver must
ensure that all the descriptors are freed before velocity_rx_refill()
is used in velocity_change_mtu(). The patch resets the Rx descriptors
in velocity_free_rd_ring().
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Diffstat (limited to 'drivers/net/via-velocity.c')
-rw-r--r-- | drivers/net/via-velocity.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c index c2d5907dc8e0..ed1f837c8fda 100644 --- a/drivers/net/via-velocity.c +++ b/drivers/net/via-velocity.c | |||
@@ -1106,6 +1106,9 @@ static void velocity_free_rd_ring(struct velocity_info *vptr) | |||
1106 | 1106 | ||
1107 | for (i = 0; i < vptr->options.numrx; i++) { | 1107 | for (i = 0; i < vptr->options.numrx; i++) { |
1108 | struct velocity_rd_info *rd_info = &(vptr->rd_info[i]); | 1108 | struct velocity_rd_info *rd_info = &(vptr->rd_info[i]); |
1109 | struct rx_desc *rd = vptr->rd_ring + i; | ||
1110 | |||
1111 | memset(rd, 0, sizeof(*rd)); | ||
1109 | 1112 | ||
1110 | if (!rd_info->skb) | 1113 | if (!rd_info->skb) |
1111 | continue; | 1114 | continue; |