From: Ben Warren <biggerbadderben@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] cs8900_initialize() cleanup [rev2]
Date: Thu, 21 Jan 2010 13:27:28 -0800 [thread overview]
Message-ID: <4B58C6C0.8030003@gmail.com> (raw)
In-Reply-To: <20100121211634.GB16182@darwin>
Matthias,
Matthias Kaehlcke wrote:
> cs8900_initialize(): remove unecessary calls to free() and fix memory leak
>
> Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>
> ---
> 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));
>
Applied to net repo.
thanks,
Ben
prev parent reply other threads:[~2010-01-21 21:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-21 21:16 [U-Boot] [PATCH] cs8900_initialize() cleanup [rev2] Matthias Kaehlcke
2010-01-21 21:27 ` Ben Warren [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B58C6C0.8030003@gmail.com \
--to=biggerbadderben@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox