summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMatthias Kaehlcke <matthias@kaehlcke.net>2010-01-21 22:16:34 +0100
committerBen Warren <biggerbadderben@gmail.com>2010-01-31 22:34:33 -0800
commit07c966066b977b24f4b08b1684eed130f463b4c6 (patch)
tree93f9ca0f72a89baa3a2cdcdc291731233b3ad3a8 /drivers
parentc4168af3ba03c17a73751b98c124bbd2e3e1f5b0 (diff)
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/cs8900.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/cs8900.c b/drivers/net/cs8900.c
index df360042be..9424fb2bb6 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));