mirror of
https://github.com/xcat2/xNBA.git
synced 2025-02-04 13:01:43 +00:00
Ensure that pxe_netdev is set before starting up PXE NBP.
This commit is contained in:
parent
cbd956535e
commit
071356d976
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user