]> git.proxmox.com Git - mirror_edk2.git/commit
MdeModulePkg/UfsBlockIoPei: Correct use of 'DeviceIndex' in BlkIO PPI
authorHao Wu <hao.a.wu@intel.com>
Tue, 12 Feb 2019 03:19:26 +0000 (11:19 +0800)
committerHao Wu <hao.a.wu@intel.com>
Mon, 25 Feb 2019 08:33:49 +0000 (16:33 +0800)
commit2df8798274429cb40da4cabc551ef6efa07c1a99
tree70d0b2ad6dd80299d464e7f7480d2022fc476b08
parent68a4e15e149771f36ba58b3adcef9b2981a4eda6
MdeModulePkg/UfsBlockIoPei: Correct use of 'DeviceIndex' in BlkIO PPI

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1474

Within UfsBlockIoPei, the current implementation of the Block IO(2)
services:

UfsBlockIoPeimGetMediaInfo
UfsBlockIoPeimReadBlocks
UfsBlockIoPeimGetMediaInfo2
UfsBlockIoPeimReadBlocks2

does not handle the input parameter 'DeviceIndex' properly.

According to both of the PI spec and the function description comments:

> DeviceIndex    Specifies the block device to which the function wants
>                to talk. ... This index is a number from one to
>                NumberBlockDevices.

But current codes incorrectly treat the valid range of 'DeviceIndex' as 0
to (NumberBlockDevices - 1).

This commit is to address this issue.

Cc: Jian J Wang <jian.j.wang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.c