Skip to content

Commit

Permalink
via-velocity: fix memory corruption when changing the mtu
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Francois Romieu committed Feb 27, 2006
1 parent de5f503 commit b3c3e7d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/via-velocity.c
Original file line number Diff line number Diff line change
Expand Up @@ -1106,6 +1106,9 @@ static void velocity_free_rd_ring(struct velocity_info *vptr)

for (i = 0; i < vptr->options.numrx; i++) {
struct velocity_rd_info *rd_info = &(vptr->rd_info[i]);
struct rx_desc *rd = vptr->rd_ring + i;

memset(rd, 0, sizeof(*rd));

if (!rd_info->skb)
continue;
Expand Down

0 comments on commit b3c3e7d

Please sign in to comment.