Dear Kumar Gala, In message <[email protected]> you wrote: > nic and hw structures are allocated via malloc i.e. return memory > is not zero initialized. Because of this few structure member like > "function pointers" are initialized with garbage values. > > It may cause problem. for eg. during eth_initialize, dev->write_hwaddr > is used. > > Signed-off-by: Kumar Gala <[email protected]> > --- > drivers/net/e1000.c | 14 ++++++++++++++ > 1 files changed, 14 insertions(+), 0 deletions(-) > > diff --git a/drivers/net/e1000.c b/drivers/net/e1000.c > index 2825342..911eb2c 100644 > --- a/drivers/net/e1000.c > +++ b/drivers/net/e1000.c > @@ -5177,7 +5177,21 @@ e1000_initialize(bd_t * bis) > } > > nic = (struct eth_device *) malloc(sizeof (*nic)); > + if (!nic) { > + printf("Error: e1000 - Can not alloc memory\n"); > + return 0; > + } > + > hw = (struct e1000_hw *) malloc(sizeof (*hw)); > + if (!nic) { --------------------^^^^ !hw
Applied after fixing the typo. Thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected] The more complex the mind, the greater the need for the simplicity of play. -- Kirk, "Shore Leave", stardate 3025.8 _______________________________________________ U-Boot mailing list [email protected] http://lists.denx.de/mailman/listinfo/u-boot

