X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=OvmfPkg%2FVirtioNetDxe%2FSnpReceive.c;h=cdee9a2aee477f750b8015e245ca54420e59807f;hb=f7978bb25869408ab24673beb9f83d9b81f8061c;hp=99abd7ebe454dde610296f665b12cf3c7b1cd6a7;hpb=56f65ed838e8d73e91d54a8ed984d777c936843c;p=mirror_edk2.git diff --git a/OvmfPkg/VirtioNetDxe/SnpReceive.c b/OvmfPkg/VirtioNetDxe/SnpReceive.c index 99abd7ebe4..cdee9a2aee 100644 --- a/OvmfPkg/VirtioNetDxe/SnpReceive.c +++ b/OvmfPkg/VirtioNetDxe/SnpReceive.c @@ -5,13 +5,7 @@ Copyright (C) 2013, Red Hat, Inc. Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.
- This program and the accompanying materials are licensed and made available - under the terms and conditions of the BSD License which accompanies this - distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT - WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -82,6 +76,7 @@ VirtioNetReceive ( UINT8 *RxPtr; UINT16 AvailIdx; EFI_STATUS NotifyStatus; + UINTN RxBufOffset; if (This == NULL || BufferSize == NULL || Buffer == NULL) { return EFI_INVALID_PARAMETER; @@ -143,7 +138,9 @@ VirtioNetReceive ( *HeaderSize = Dev->Snm.MediaHeaderSize; } - RxPtr = (UINT8 *)(UINTN) Dev->RxRing.Desc[DescIdx + 1].Addr; + RxBufOffset = (UINTN)(Dev->RxRing.Desc[DescIdx + 1].Addr - + Dev->RxBufDeviceBase); + RxPtr = Dev->RxBuf + RxBufOffset; CopyMem (Buffer, RxPtr, RxLen); if (DestAddr != NULL) {