if ( ( rc = efi_snp_hii_install ( snpdev ) ) != 0 ) {
DBGC ( snpdev, "SNPDEV %p could not install HII: %s\n",
snpdev, strerror ( rc ) );
- goto err_hii_install;
+ /* HII fails on several platforms. It's
+ * non-essential, so treat this as a non-fatal
+ * error.
+ */
}
/* Add to list of SNP devices */
efi_devpath_text ( &snpdev->path ) );
return 0;
- efi_snp_hii_uninstall ( snpdev );
- err_hii_install:
+ if ( snpdev->package_list )
+ efi_snp_hii_uninstall ( snpdev );
efidev_child_del ( efidev, snpdev->handle );
err_efidev_child_add:
bs->UninstallMultipleProtocolInterfaces (
}
/* Uninstall the SNP */
- efi_snp_hii_uninstall ( snpdev );
+ if ( snpdev->package_list )
+ efi_snp_hii_uninstall ( snpdev );
efidev_child_del ( snpdev->efidev, snpdev->handle );
list_del ( &snpdev->list );
bs->UninstallMultipleProtocolInterfaces (
int rc;
/* Do nothing if HII database protocol is not supported */
- if ( ! efihii )
- return 0;
+ if ( ! efihii ) {
+ rc = -ENOTSUP;
+ goto err_no_hii;
+ }
/* Initialise HII protocol */
memcpy ( &snpdev->hii, &efi_snp_device_hii, sizeof ( snpdev->hii ) );
free ( snpdev->package_list );
snpdev->package_list = NULL;
err_build_package_list:
+ err_no_hii:
return rc;
}