提交 adb57512 编写于 作者: H Heinrich Schuchardt 提交者: Alexander Graf

efi_loader: correctly determine length of empty device path

efi_dp_size() is meant to return the device path length without the end
node.

The length of a device path containing only an end node was incorrectly
reported as 4.
Signed-off-by: NHeinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: NAlexander Graf <agraf@suse.de>
上级 07836345
......@@ -234,6 +234,8 @@ unsigned efi_dp_size(const struct efi_device_path *dp)
{
unsigned sz = 0;
if (!dp || dp->type == DEVICE_PATH_TYPE_END)
return 0;
while (dp) {
sz += dp->length;
dp = efi_dp_next(dp);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册