Skip to content

Commit

Permalink
[STRIP]: Fix neighbour table refcount leak.
Browse files Browse the repository at this point in the history
Found by inspection. The STRIP driver does neigh_lookup() but never
releases.  This driver shouldn't being doing gratuitous arp anyway.

Untested, obviously, because of lack of hardware.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Aug 30, 2006
1 parent 57f5f54 commit ee1377c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/net/wireless/strip.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,17 +467,19 @@ static int arp_query(unsigned char *haddr, u32 paddr,
struct net_device *dev)
{
struct neighbour *neighbor_entry;
int ret = 0;

neighbor_entry = neigh_lookup(&arp_tbl, &paddr, dev);

if (neighbor_entry != NULL) {
neighbor_entry->used = jiffies;
if (neighbor_entry->nud_state & NUD_VALID) {
memcpy(haddr, neighbor_entry->ha, dev->addr_len);
return 1;
ret = 1;
}
neigh_release(neighbor_entry);
}
return 0;
return ret;
}

static void DumpData(char *msg, struct strip *strip_info, __u8 * ptr,
Expand Down

0 comments on commit ee1377c

Please sign in to comment.