[PATCH 08/10] introduce common bootstrap code
Alexander Aring
alex.aring at gmail.com
Mon Jan 21 08:09:08 EST 2013
Hi,
ok, thanks for this information.
Regards
Alex
2013/1/21 Sascha Hauer <s.hauer at pengutronix.de>
> On Mon, Jan 21, 2013 at 12:04:16PM +0100, Alexander Aring wrote:
> > hi,
> >
> > found a little 'things'. Maybe it's matter.
> >
> > > +
> > > + cdev = cdev_open(name, O_RDONLY);
> > > + if (!cdev) {
> > > + bootstrap_err("failed to open partition\n");
> > > + return NULL;
> > > + }
> > > +
> > > + ret = cdev_read(cdev, header, BAREBOX_HEAD_SIZE, 0, 0);
> > >
> > check on error here?
> >
>
> This is done, see below.
>
> >
> > > + cdev_close(cdev);
> > > +
> > > + if (ret != BAREBOX_HEAD_SIZE) {
> > > + bootstrap_err("failed to read from partition\n");
> > > + return NULL;
> > > + }
> > > +
> > > + return header;
> > > +}
> > > +
> > > +
> > > + if (!size) {
> > > + size = default_size;
> > > + bootstrap_err("%s: failed to detect barebox and it's
> image
> > > size so use %d\n",
> > > + devname, size);
> > > + }
> > > +
> > > + to = xmalloc(size);
> > >
> > check on null here?
>
> The x versions always return memory or else they panic.
>
> Sascha
>
>
> --
> Pengutronix e.K. | |
> Industrial Linux Solutions | http://www.pengutronix.de/ |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
> Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/barebox/attachments/20130121/a1af3aba/attachment.html>
More information about the barebox
mailing list