[U-Boot] [PATCH 1/2] net/eth.c: make eth_get_dev_by_name(NULL) safe

2011-07-04 Thread helmut . raiger
From: Helmut Raiger eth_get_dev_by_name() is not safe to use for devname being NULL as it uses strcmp. This patch makes it return NULL if devname NULL is passed. Signed-off-by: Helmut Raiger --- net/eth.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/net/eth.c b/net

Re: [U-Boot] [PATCH 1/2] net/eth.c: make eth_get_dev_by_name(NULL) safe

2011-07-04 Thread Mike Frysinger
On Monday, July 04, 2011 06:29:51 helmut.rai...@hale.at wrote: > eth_get_dev_by_name() is not safe to use for devname being NULL > as it uses strcmp. This patch makes it return NULL if devname NULL > is passed. i'm not sure about this. passing NULL is wrong, and the caller should catch that shou

Re: [U-Boot] [PATCH 1/2] net/eth.c: make eth_get_dev_by_name(NULL) safe

2011-07-06 Thread Helmut Raiger
On 07/05/2011 05:44 AM, Mike Frysinger wrote: > On Monday, July 04, 2011 06:29:51 helmut.rai...@hale.at wrote: >> eth_get_dev_by_name() is not safe to use for devname being NULL >> as it uses strcmp. This patch makes it return NULL if devname NULL >> is passed. > i'm not sure about this. passing N

Re: [U-Boot] [PATCH 1/2] net/eth.c: make eth_get_dev_by_name(NULL) safe

2011-07-06 Thread Mike Frysinger
On Wednesday, July 06, 2011 03:15:08 Helmut Raiger wrote: > On 07/05/2011 05:44 AM, Mike Frysinger wrote: > > On Monday, July 04, 2011 06:29:51 helmut.rai...@hale.at wrote: > >> eth_get_dev_by_name() is not safe to use for devname being NULL > >> as it uses strcmp. This patch makes it return NULL i

Re: [U-Boot] [PATCH 1/2] net/eth.c: make eth_get_dev_by_name(NULL) safe

2011-07-06 Thread Helmut Raiger
On 07/06/2011 09:38 PM, Mike Frysinger wrote: > On Wednesday, July 06, 2011 03:15:08 Helmut Raiger wrote: >> On 07/05/2011 05:44 AM, Mike Frysinger wrote: >>> On Monday, July 04, 2011 06:29:51 helmut.rai...@hale.at wrote: eth_get_dev_by_name() is not safe to use for devname being NULL as

Re: [U-Boot] [PATCH 1/2] net/eth.c: make eth_get_dev_by_name(NULL) safe

2011-07-07 Thread Detlev Zundel
Hi Helmut, > On 07/06/2011 09:38 PM, Mike Frysinger wrote: >> On Wednesday, July 06, 2011 03:15:08 Helmut Raiger wrote: >>> On 07/05/2011 05:44 AM, Mike Frysinger wrote: On Monday, July 04, 2011 06:29:51 helmut.rai...@hale.at wrote: > eth_get_dev_by_name() is not safe to use for devname b

Re: [U-Boot] [PATCH 1/2] net/eth.c: make eth_get_dev_by_name(NULL) safe

2011-07-07 Thread Albert ARIBAUD
Hi Helmut, Le 04/07/2011 12:29, helmut.rai...@hale.at a écrit : > From: Helmut Raiger Seems like your git send-email config does not have your name along with your e-mail address, causing this From: to appear in the patch body (and the mail itself to lack your name) -- git can handle this, I th

Re: [U-Boot] [PATCH 1/2] net/eth.c: make eth_get_dev_by_name(NULL) safe

2011-07-07 Thread Mike Frysinger
On Thu, Jul 7, 2011 at 02:12, Helmut Raiger wrote: > On 07/06/2011 09:38 PM, Mike Frysinger wrote: >> On Wednesday, July 06, 2011 03:15:08 Helmut Raiger wrote: >>> On 07/05/2011 05:44 AM, Mike Frysinger wrote: On Monday, July 04, 2011 06:29:51 helmut.rai...@hale.at wrote: > eth_get_dev_by_

Re: [U-Boot] [PATCH 1/2] net/eth.c: make eth_get_dev_by_name(NULL) safe

2011-07-11 Thread Helmut Raiger
On 07/07/2011 07:46 PM, Mike Frysinger wrote: > > those NULL checks should not be necessary either. a correctly written > networking driver should only register itself with the miiphy layer > when it has successfully registered itself with the eth layer. thus > any of the miiphy callbacks should

Re: [U-Boot] [PATCH 1/2] net/eth.c: make eth_get_dev_by_name(NULL) safe

2011-07-11 Thread Helmut Raiger
On 07/07/2011 06:46 PM, Albert ARIBAUD wrote: > Hi Helmut, > > Le 04/07/2011 12:29, helmut.rai...@hale.at a écrit : >> From: Helmut Raiger > > Seems like your git send-email config does not have your name along > with your e-mail address, causing this From: to appear in the patch > body (and the

Re: [U-Boot] [PATCH 1/2] net/eth.c: make eth_get_dev_by_name(NULL) safe

2011-07-11 Thread Mike Frysinger
On Monday, July 11, 2011 05:53:49 Helmut Raiger wrote: > On 07/07/2011 07:46 PM, Mike Frysinger wrote: > > those NULL checks should not be necessary either. a correctly written > > networking driver should only register itself with the miiphy layer > > when it has successfully registered itself wi

Re: [U-Boot] [PATCH 1/2] net/eth.c: make eth_get_dev_by_name(NULL) safe

2011-07-12 Thread Detlev Zundel
Hi Mike, > On Monday, July 11, 2011 05:53:49 Helmut Raiger wrote: >> On 07/07/2011 07:46 PM, Mike Frysinger wrote: >> > those NULL checks should not be necessary either. a correctly written >> > networking driver should only register itself with the miiphy layer >> > when it has successfully regi

Re: [U-Boot] [PATCH 1/2] net/eth.c: make eth_get_dev_by_name(NULL) safe

2011-07-12 Thread Mike Frysinger
On Tue, Jul 12, 2011 at 05:22, Detlev Zundel wrote: > Mike Frysinger wrote: >> but the point isnt the impact of this single check.  it sets the >> precedence that every function in u-boot that takes a pointer should >> start over protecting itself against poorly written code originating >> elsewher

Re: [U-Boot] [PATCH 1/2] net/eth.c: make eth_get_dev_by_name(NULL) safe

2011-07-12 Thread Helmut Raiger
On 07/12/2011 11:22 AM, Detlev Zundel wrote: > i did go through the level of detail and showed the call graphs ... > none of > which should allow a driver tested as working to even once hit the > NULL path. As I said, these are the call graphs currently existing... This was also my trail.

Re: [U-Boot] [PATCH 1/2] net/eth.c: make eth_get_dev_by_name(NULL) safe

2011-07-13 Thread Detlev Zundel
Hi Mike, [...] > not really. i consider this to be "garbage-in garbage-out". imo, > u-boot isnt a C library that should be padded with garbage checking > all over. the result only helps broken systems (edge cases) while > hindering the rest. > > i wouldnt have a problem with adopting an NDEBUG

Re: [U-Boot] [PATCH 1/2] net/eth.c: make eth_get_dev_by_name(NULL) safe

2011-07-13 Thread Detlev Zundel
Hi Helmut, > On 07/12/2011 11:22 AM, Detlev Zundel wrote: > >> > i did go through the level of detail and showed the call graphs ... >> > none of >> > which should allow a driver tested as working to even once hit the >> > NULL path. >> >> As I said, these are the call graphs currently existing..

Re: [U-Boot] [PATCH 1/2] net/eth.c: make eth_get_dev_by_name(NULL) safe

2011-07-14 Thread Helmut Raiger
On 07/13/2011 01:46 PM, Detlev Zundel wrote: > >> The NDEBUG approach however, as Mike suggested, was what I was >> looking for in the first place. > Great! >Detlev > Again, not so great. U-boot uses all kinds of assert(), BUG_ON(), ASSERT() all over the place. This probably needs a project

Re: [U-Boot] [PATCH 1/2] net/eth.c: make eth_get_dev_by_name(NULL) safe

2011-07-14 Thread Albert ARIBAUD
Hi Helmut, Le 11/07/2011 12:10, Helmut Raiger a écrit : > On 07/07/2011 06:46 PM, Albert ARIBAUD wrote: >> Hi Helmut, >> >> Le 04/07/2011 12:29, helmut.rai...@hale.at a écrit : >>> From: Helmut Raiger >> >> Seems like your git send-email config does not have your name along >> with your e-mail add

Re: [U-Boot] [PATCH 1/2] net/eth.c: make eth_get_dev_by_name(NULL) safe

2011-07-14 Thread Mike Frysinger
On Thursday, July 14, 2011 05:14:07 Helmut Raiger wrote: > On 07/13/2011 01:46 PM, Detlev Zundel wrote: > >> The NDEBUG approach however, as Mike suggested, was what I was > >> looking for in the first place. > > Again, not so great. U-boot uses all kinds of assert(), BUG_ON(), > ASSERT() all ove

Re: [U-Boot] [PATCH 1/2] net/eth.c: make eth_get_dev_by_name(NULL) safe

2011-07-14 Thread Mike Frysinger
On Wednesday, July 13, 2011 02:32:37 Helmut Raiger wrote: for future reference, please dont send html e-mails -mike signature.asc Description: This is a digitally signed message part. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/ma