From: Ajay Bhargav <ajay.bhargav@einfochips.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 1/3] net: Adds Fast Ethernet Controller driver for Armada100
Date: Mon, 29 Aug 2011 10:40:49 +0530 (IST) [thread overview]
Message-ID: <1181873733.14337.1314594649534.JavaMail.root@ahm.einfochips.com> (raw)
In-Reply-To: <706935361.14309.1314594441316.JavaMail.root@ahm.einfochips.com>
----- "Mike Frysinger" <vapier@gentoo.org> wrote:
> On Friday, August 26, 2011 02:36:51 Ajay Bhargav wrote:
> > +static int add_del_hash_entry(struct armdfec_device *darmdfec, u32
> mach,
> > + u32 macl, u32 rd, u32 skip, int del)
> > +{
> > + u8 *last;
>
> local var ...
>
> > + last = (u8 *) entry;
> > + last = last + sizeof(*entry);
> > +
> > + return 0;
> > +}
>
> so what's the point of these two assignments to "last" ?
>
I forgot to delete them during cleanup of initial code. Thanks for
pointing.
> > +int armada100_fec_register(int base_addr)
>
> when it comes to addresses for memory mapped registers, we typically
> use
> "unsigned long" rather than "int"
>
yes right...
> > + darmdfec = malloc(sizeof(struct armdfec_device));
> > + if (!darmdfec)
> > + goto error;
>
> if this first one fails, we jump to:
>
> > +error:
> > + free(darmdfec->p_aligned_txbuf);
> > + free(darmdfec->p_rxbuf);
> > + free(darmdfec->p_rxdesc);
> > + free(darmdfec->htpr);
>
> looks like 4 NULL pointer derefs. so you'll need one specific path
> for the
> first malloc(), but the rest are fine.
> -mike
so you mean like this...
if(!darmdfec)
goto error;
...
error1:
free(darmdfec->p_aligned_txbuf);
free(darmdfec->p_rxbuf);
free(darmdfec->p_rxdesc);
free(darmdfec->htpr);
error:
free(darmdfec);
return -1;
Thanks,
Ajay Bhargav
next parent reply other threads:[~2011-08-29 5:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <706935361.14309.1314594441316.JavaMail.root@ahm.einfochips.com>
2011-08-29 5:10 ` Ajay Bhargav [this message]
2011-08-29 5:30 ` [U-Boot] [PATCH v3 1/3] net: Adds Fast Ethernet Controller driver for Armada100 Mike Frysinger
2011-08-29 5:39 ` Ajay Bhargav
2011-08-29 10:12 ` Marek Vasut
2011-08-29 19:39 ` Mike Frysinger
2011-08-30 5:15 ` Ajay Bhargav
[not found] <274121072.14489.1314595589918.JavaMail.root@ahm.einfochips.com>
2011-08-29 5:26 ` Ajay Bhargav
2011-08-26 6:36 Ajay Bhargav
2011-08-26 15:32 ` Marek Vasut
2011-08-26 20:01 ` Mike Frysinger
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=1181873733.14337.1314594649534.JavaMail.root@ahm.einfochips.com \
--to=ajay.bhargav@einfochips.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