summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorPali Rohár <pali.rohar@gmail.com>2013-01-12 14:26:47 +0100
committerPali Rohár <pali.rohar@gmail.com>2013-01-12 14:26:47 +0100
commit3480526cdef7f3796e33f0c607f9c21e57480a8c (patch)
treecd130f9d86221c5be96cc6ba2a647935458f14ed /src/main.c
parent7dd8fdb560d81ef4ad70ec2e0973de77ee96a762 (diff)
download0xFFFF-3480526cdef7f3796e33f0c607f9c21e57480a8c.tar.bz2
main: Fix loading kernel & initfs images
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/main.c b/src/main.c
index ca6f1a5..6e5b066 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1037,29 +1037,29 @@ int main(int argc, char **argv) {
/* load */
if ( dev_load ) {
- ret = 0;
-
- if ( image_kernel )
+ if ( image_kernel ) {
ret = dev_load_image(dev, image_kernel->image);
- if ( ret < 0 )
- goto again;
+ if ( ret < 0 )
+ goto again;
- if ( image_kernel == image_first )
- image_first = image_first->next;
- image_list_unlink(image_kernel);
- free(image_kernel);
- image_kernel = NULL;
+ if ( image_kernel == image_first )
+ image_first = image_first->next;
+ image_list_unlink(image_kernel);
+ free(image_kernel);
+ image_kernel = NULL;
+ }
- if ( image_initfs )
+ if ( image_initfs ) {
ret = dev_load_image(dev, image_initfs->image);
- if ( ret < 0 )
- goto again;
+ if ( ret < 0 )
+ goto again;
- if ( image_initfs == image_first )
- image_first = image_first->next;
- image_list_unlink(image_initfs);
- free(image_initfs);
- image_initfs = NULL;
+ if ( image_initfs == image_first )
+ image_first = image_first->next;
+ image_list_unlink(image_initfs);
+ free(image_initfs);
+ image_initfs = NULL;
+ }
}
/* flash */