Is this a barebox bootm memory release Bug ?

Gabor Janak ( g.janak at
Wed Mar 18 09:28:26 PDT 2015


I have one little question.
In [barebox.git] / common / bootm.c Line 201

196        if (data->verify) {
197                 ret = uimage_verify(data->os);
198                 if (ret) {
199                         printf("Checking data crc failed with %s\n",
200                                         strerror(-ret));
201                         uimage_close(data->os);
202                         return ret;
203                 }
204         }

The uimage is closed but data->os is not set to NULL.

If this function is called from  bootm_boot in
472                 ret = handler->bootm(data);

482         if (data->os)
483                 uimage_close(data->os);

will crash free something ....
Will end in a possible
unable to handle paging request at address 0xfe148f0e

Is this a correct analyze ?
If yes, it's enough to add an data->os=NULL after uimage_close ?

I would ask this here before submitting a patch.

In best regards
Gabor Janak

[Hannover Messe]<>

More information about the barebox mailing list