diff options
author | Matthias Kaehlcke <matthias@kaehlcke.net> | 2010-01-21 21:16:34 (GMT) |
---|---|---|
committer | Ben Warren <biggerbadderben@gmail.com> | 2010-02-01 06:34:33 (GMT) |
commit | 07c966066b977b24f4b08b1684eed130f463b4c6 (patch) | |
tree | 93f9ca0f72a89baa3a2cdcdc291731233b3ad3a8 | |
parent | c4168af3ba03c17a73751b98c124bbd2e3e1f5b0 (diff) | |
download | u-boot-fsl-qoriq-07c966066b977b24f4b08b1684eed130f463b4c6.tar.xz |
cs8900_initialize() cleanup
cs8900_initialize(): remove unecessary calls to free() and fix memory leak
Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
-rw-r--r-- | drivers/net/cs8900.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/cs8900.c b/drivers/net/cs8900.c index df36004..9424fb2 100644 --- a/drivers/net/cs8900.c +++ b/drivers/net/cs8900.c @@ -308,14 +308,13 @@ int cs8900_initialize(u8 dev_num, int base_addr) dev = malloc(sizeof(*dev)); if (!dev) { - free(dev); return 0; } memset(dev, 0, sizeof(*dev)); priv = malloc(sizeof(*priv)); if (!priv) { - free(priv); + free(dev); return 0; } memset(priv, 0, sizeof(*priv)); |