<div dir="ltr">Hi,<br><br>ok, thanks for this information.<br><br>Regards<br>Alex<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/1/21 Sascha Hauer <span dir="ltr"><<a href="mailto:s.hauer@pengutronix.de" target="_blank">s.hauer@pengutronix.de</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Mon, Jan 21, 2013 at 12:04:16PM +0100, Alexander Aring wrote:<br>
> hi,<br>
><br>
> found a little 'things'. Maybe it's matter.<br>
><br>
</div><div class="im">> > +<br>
> > + cdev = cdev_open(name, O_RDONLY);<br>
> > + if (!cdev) {<br>
> > + bootstrap_err("failed to open partition\n");<br>
> > + return NULL;<br>
> > + }<br>
> > +<br>
> > + ret = cdev_read(cdev, header, BAREBOX_HEAD_SIZE, 0, 0);<br>
> ><br>
> check on error here?<br>
><br>
<br>
</div>This is done, see below.<br>
<div class="im"><br>
><br>
> > + cdev_close(cdev);<br>
> > +<br>
> > + if (ret != BAREBOX_HEAD_SIZE) {<br>
> > + bootstrap_err("failed to read from partition\n");<br>
> > + return NULL;<br>
> > + }<br>
> > +<br>
> > + return header;<br>
> > +}<br>
> > +<br>
</div><div class="im">> > +<br>
> > + if (!size) {<br>
> > + size = default_size;<br>
> > + bootstrap_err("%s: failed to detect barebox and it's image<br>
> > size so use %d\n",<br>
> > + devname, size);<br>
> > + }<br>
> > +<br>
> > + to = xmalloc(size);<br>
> ><br>
> check on null here?<br>
<br>
</div>The x versions always return memory or else they panic.<br>
<span class="HOEnZb"><font color="#888888"><br>
Sascha<br>
<br>
<br>
--<br>
Pengutronix e.K. | |<br>
Industrial Linux Solutions | <a href="http://www.pengutronix.de/" target="_blank">http://www.pengutronix.de/</a> |<br>
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: <a href="tel:%2B49-5121-206917-0" value="+4951212069170">+49-5121-206917-0</a> |<br>
Amtsgericht Hildesheim, HRA 2686 | Fax: <a href="tel:%2B49-5121-206917-5555" value="+4951212069175555">+49-5121-206917-5555</a> |<br>
</font></span></blockquote></div><br></div>