mirror of https://github.com/acidanthera/audk.git
MdeModulePkg NvmExpressDxe: Refine GetNextNamespace API to follow spec
According to the UEFI spec, EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL.GetNextNamespace() should return EFI_NOT_FOUND when the value pointed to by NamespaceId is the namespace ID of the last namespace on the NVM Express controller. This commit modifies the check for NamespaceId to follow this rule. Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
This commit is contained in:
parent
284dc9bfe4
commit
114358eaa8
|
@ -758,11 +758,15 @@ NvmExpressGetNextNamespace (
|
|||
|
||||
*NamespaceId = NextNamespaceId;
|
||||
} else {
|
||||
if (*NamespaceId >= Private->ControllerData->Nn) {
|
||||
if (*NamespaceId > Private->ControllerData->Nn) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
NextNamespaceId = *NamespaceId + 1;
|
||||
if (NextNamespaceId > Private->ControllerData->Nn) {
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
//
|
||||
// Allocate buffer for Identify Namespace data.
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue