Skip to content

Commit

Permalink
net pkgen.c:fix no need for check
Browse files Browse the repository at this point in the history
vfree() does its own 'NULL' check, so no need for check before
calling it.

Signed-off-by: Figo.zhang <figo1802@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Figo.zhang authored and David S. Miller committed Jun 8, 2009
1 parent a5b19b6 commit 1d0ebfe
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions net/core/pktgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -3691,8 +3691,7 @@ static int pktgen_add_device(struct pktgen_thread *t, const char *ifname)
#ifdef CONFIG_XFRM
free_SAs(pkt_dev);
#endif
if (pkt_dev->flows)
vfree(pkt_dev->flows);
vfree(pkt_dev->flows);
kfree(pkt_dev);
return err;
}
Expand Down Expand Up @@ -3791,8 +3790,7 @@ static int pktgen_remove_device(struct pktgen_thread *t,
#ifdef CONFIG_XFRM
free_SAs(pkt_dev);
#endif
if (pkt_dev->flows)
vfree(pkt_dev->flows);
vfree(pkt_dev->flows);
kfree(pkt_dev);
return 0;
}
Expand Down

0 comments on commit 1d0ebfe

Please sign in to comment.