summaryrefslogtreecommitdiffstats
path: root/src/usr/autoboot.c
diff options
context:
space:
mode:
authorMichael Brown2007-06-28 18:55:29 +0200
committerMichael Brown2007-06-28 18:55:29 +0200
commit4b08f4cf0f06b3345466f7d5d7ef4c04d45ecc56 (patch)
tree7bf42f686105cb65dc79bad8b789deca22f01d6e /src/usr/autoboot.c
parentUse monojob and dhcp_configure_netdev(). (diff)
downloadipxe-4b08f4cf0f06b3345466f7d5d7ef4c04d45ecc56.tar.gz
ipxe-4b08f4cf0f06b3345466f7d5d7ef4c04d45ecc56.tar.xz
ipxe-4b08f4cf0f06b3345466f7d5d7ef4c04d45ecc56.zip
Quick hack to get image booting working again
Diffstat (limited to 'src/usr/autoboot.c')
-rw-r--r--src/usr/autoboot.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/usr/autoboot.c b/src/usr/autoboot.c
index 5d017229..3936e4ca 100644
--- a/src/usr/autoboot.c
+++ b/src/usr/autoboot.c
@@ -99,19 +99,27 @@ void netboot ( struct net_device *netdev ) {
return;
}
printf ( "Booting \"%s\"\n", filename );
- if ( ( rc = imgfetch ( filename, NULL, &image ) ) != 0 ) {
+ image = alloc_image();
+ if ( ! image ) {
+ printf ( "Out of memory\n" );
+ return;
+ }
+ if ( ( rc = imgfetch ( image, filename, 0 ) ) != 0 ) {
printf ( "Could not retrieve %s: %s\n",
filename, strerror ( rc ) );
+ image_put ( image );
return;
}
if ( ( rc = imgload ( image ) ) != 0 ) {
printf ( "Could not load %s: %s\n", image->name,
strerror ( rc ) );
+ image_put ( image );
return;
}
if ( ( rc = imgexec ( image ) ) != 0 ) {
printf ( "Could not execute %s: %s\n", image->name,
strerror ( rc ) );
+ image_put ( image );
return;
}
}