mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Alexander Aring <alex.aring@gmail.com>
Cc: barebox <barebox@lists.infradead.org>
Subject: Re: [PATCH 08/10] introduce common bootstrap code
Date: Mon, 21 Jan 2013 13:51:09 +0100	[thread overview]
Message-ID: <20130121125109.GA1906@pengutronix.de> (raw)
In-Reply-To: <CAB_54W76DctVP5c_aeghd+Bh+7Lr86sGLJ=BdGQrg40npCTnYA@mail.gmail.com>

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 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2013-01-21 12:51 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-21 10:23 [PATCH 00/10 v5] at91: add bootstrap support Jean-Christophe PLAGNIOL-VILLARD
2013-01-21 10:27 ` [PATCH 01/10] filetype: add is_barebox_mips_head support Jean-Christophe PLAGNIOL-VILLARD
2013-01-21 10:27   ` [PATCH 02/10] filetype: add is_barebox_head Jean-Christophe PLAGNIOL-VILLARD
2013-01-21 10:27   ` [PATCH 03/10] at91: dump mux command: make it depends on COMMAND_SUPPORT Jean-Christophe PLAGNIOL-VILLARD
2013-01-21 10:27   ` [PATCH 04/10] at91: add test commamd to emulate bootrom boot Jean-Christophe PLAGNIOL-VILLARD
2013-01-21 11:04     ` Alexander Aring
2013-01-21 10:27   ` [PATCH 05/10] at91sam926x: lowlevel add external boot support Jean-Christophe PLAGNIOL-VILLARD
2013-01-21 10:27   ` [PATCH 06/10] at91: sam926x: switch lowlevel param to c code Jean-Christophe PLAGNIOL-VILLARD
2013-01-21 10:27   ` [PATCH 07/10] at91: usb-a9263 add lowlevel init Jean-Christophe PLAGNIOL-VILLARD
2013-01-21 10:27   ` [PATCH 08/10] introduce common bootstrap code Jean-Christophe PLAGNIOL-VILLARD
2013-01-21 11:04     ` Alexander Aring
2013-01-21 12:51       ` Sascha Hauer [this message]
2013-01-21 13:09         ` Alexander Aring
2013-01-21 13:59         ` Jean-Christophe PLAGNIOL-VILLARD
2013-01-21 14:26           ` Jean-Christophe PLAGNIOL-VILLARD
2013-01-21 10:27   ` [PATCH 09/10] at91: add bootstrap version Jean-Christophe PLAGNIOL-VILLARD
2013-01-21 10:27   ` [PATCH 10/10] at91: usb_a9263: " Jean-Christophe PLAGNIOL-VILLARD
2013-01-21 14:28 [PATCH 00/10 v6] at91: add bootstrap support Jean-Christophe PLAGNIOL-VILLARD
2013-01-21 14:33 ` [PATCH 01/10] filetype: add is_barebox_mips_head support Jean-Christophe PLAGNIOL-VILLARD
2013-01-21 14:33   ` [PATCH 08/10] introduce common bootstrap code Jean-Christophe PLAGNIOL-VILLARD
2013-01-22 14:38 [PATCH 00/10 v7] at91: add bootstrap support Jean-Christophe PLAGNIOL-VILLARD
2013-01-22 14:40 ` [PATCH 01/10] filetype: add is_barebox_mips_head support Jean-Christophe PLAGNIOL-VILLARD
2013-01-22 14:40   ` [PATCH 08/10] introduce common bootstrap code Jean-Christophe PLAGNIOL-VILLARD

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=20130121125109.GA1906@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=alex.aring@gmail.com \
    --cc=barebox@lists.infradead.org \
    /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