david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

Ensure that pxe_netdev is set before starting up PXE NBP.

This commit is contained in:
Michael Brown 2007-07-03 00:02:26 +01:00
parent cbd956535e
commit 071356d976
1 changed files with 10 additions and 3 deletions

View File

@ -38,7 +38,7 @@ struct image_type pxe_image_type __image_type ( PROBE_PXE );
* @v image PXE image
* @ret rc Return status code
*/
static int pxe_exec ( struct image *image __unused ) {
static int pxe_exec ( struct image *image ) {
struct net_device *netdev;
int rc;
@ -52,6 +52,13 @@ static int pxe_exec ( struct image *image __unused ) {
break;
}
/* Many things will break if pxe_netdev is NULL */
if ( ! pxe_netdev ) {
DBGC ( image, "IMAGE %p could not locate PXE net device\n",
image );
return -ENODEV;
}
/* Start PXE NBP */
rc = pxe_start_nbp();
@ -80,8 +87,8 @@ int pxe_load ( struct image *image ) {
/* Verify and prepare segment */
if ( ( rc = prep_segment ( buffer, filesz, memsz ) ) != 0 ) {
DBG ( "PXE image could not prepare segment: %s\n",
strerror ( rc ) );
DBGC ( image, "IMAGE %p could not prepare segment: %s\n",
image, strerror ( rc ) );
return rc;
}