diff options
author | Dan Carpenter <error27@gmail.com> | 2010-06-09 17:59:03 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-06-11 21:37:07 -0400 |
commit | fc0ba8e87189b02683177116932fa580ab97b7ff (patch) | |
tree | ba9bac6b668cf6e5bbb2d1a55767302397641471 | |
parent | 62522d36d74a843e78d17f2dffc90468c6762803 (diff) |
enic: cleanup vic_provinfo_alloc()
If oui were a null variable then vic_provinfo_alloc() would leak memory.
But this function is only called from one place and oui is not null so
I removed the check.
I also moved the memory allocation down a line so it was easier to spot.
(No one ever reads variable declarations).
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/enic/vnic_vic.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/enic/vnic_vic.c b/drivers/net/enic/vnic_vic.c index d769772998c6..0a35085004d0 100644 --- a/drivers/net/enic/vnic_vic.c +++ b/drivers/net/enic/vnic_vic.c | |||
@@ -25,9 +25,10 @@ | |||
25 | 25 | ||
26 | struct vic_provinfo *vic_provinfo_alloc(gfp_t flags, u8 *oui, u8 type) | 26 | struct vic_provinfo *vic_provinfo_alloc(gfp_t flags, u8 *oui, u8 type) |
27 | { | 27 | { |
28 | struct vic_provinfo *vp = kzalloc(VIC_PROVINFO_MAX_DATA, flags); | 28 | struct vic_provinfo *vp; |
29 | 29 | ||
30 | if (!vp || !oui) | 30 | vp = kzalloc(VIC_PROVINFO_MAX_DATA, flags); |
31 | if (!vp) | ||
31 | return NULL; | 32 | return NULL; |
32 | 33 | ||
33 | memcpy(vp->oui, oui, sizeof(vp->oui)); | 34 | memcpy(vp->oui, oui, sizeof(vp->oui)); |