public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] MdeModulePkg/NonDiscoverablePciDeviceDxe: Add NULL pointer check
@ 2020-09-11 17:16 Jeff Brasen
  2020-09-15  1:47 ` Wu, Hao A
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Brasen @ 2020-09-11 17:16 UTC (permalink / raw)
  To: devel; +Cc: hao.a.wu, ray.ni, Jeff Brasen

Add check for NULL HostAddress in AllocateBuffer as required by UEFI
specification.

Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
---
 .../NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c  | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c
index a40c1a9593..363c4a765b 100644
--- a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c
+++ b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c
@@ -856,6 +856,10 @@ CoherentPciIoAllocateBuffer (
     return EFI_UNSUPPORTED;
   }
 
+  if (HostAddress == NULL) {
+    return EFI_INVALID_PARAMETER;
+  }
+
   if ((MemoryType != EfiBootServicesData) &&
       (MemoryType != EfiRuntimeServicesData)) {
     return EFI_INVALID_PARAMETER;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] MdeModulePkg/NonDiscoverablePciDeviceDxe: Add NULL pointer check
  2020-09-11 17:16 [PATCH] MdeModulePkg/NonDiscoverablePciDeviceDxe: Add NULL pointer check Jeff Brasen
@ 2020-09-15  1:47 ` Wu, Hao A
  2020-09-18  2:47   ` [edk2-devel] " Wu, Hao A
  0 siblings, 1 reply; 3+ messages in thread
From: Wu, Hao A @ 2020-09-15  1:47 UTC (permalink / raw)
  To: Jeff Brasen, devel@edk2.groups.io; +Cc: Ni, Ray

Reviewed-by: Hao A Wu <hao.a.wu@intel.com>

Best Regards,
Hao Wu

> -----Original Message-----
> From: Jeff Brasen <jbrasen@nvidia.com>
> Sent: Saturday, September 12, 2020 1:17 AM
> To: devel@edk2.groups.io
> Cc: Wu, Hao A <hao.a.wu@intel.com>; Ni, Ray <ray.ni@intel.com>; Jeff
> Brasen <jbrasen@nvidia.com>
> Subject: [PATCH] MdeModulePkg/NonDiscoverablePciDeviceDxe: Add NULL
> pointer check
> 
> Add check for NULL HostAddress in AllocateBuffer as required by UEFI
> specification.
> 
> Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
> ---
>  .../NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c  | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git
> a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverable
> PciDeviceIo.c
> b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverable
> PciDeviceIo.c
> index a40c1a9593..363c4a765b 100644
> ---
> a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverable
> PciDeviceIo.c
> +++
> b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverable
> Pc
> +++ iDeviceIo.c
> @@ -856,6 +856,10 @@ CoherentPciIoAllocateBuffer (
>      return EFI_UNSUPPORTED;   } +  if (HostAddress == NULL) {+    return
> EFI_INVALID_PARAMETER;+  }+   if ((MemoryType != EfiBootServicesData)
> &&       (MemoryType != EfiRuntimeServicesData)) {     return
> EFI_INVALID_PARAMETER;--
> 2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [edk2-devel] [PATCH] MdeModulePkg/NonDiscoverablePciDeviceDxe: Add NULL pointer check
  2020-09-15  1:47 ` Wu, Hao A
@ 2020-09-18  2:47   ` Wu, Hao A
  0 siblings, 0 replies; 3+ messages in thread
From: Wu, Hao A @ 2020-09-18  2:47 UTC (permalink / raw)
  To: devel@edk2.groups.io, Wu, Hao A, Jeff Brasen; +Cc: Ni, Ray

Pushed via commit 698d3d7726232694018d437279dd4166e462deb7.

Best Regards,
Hao Wu

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Wu, Hao A
> Sent: Tuesday, September 15, 2020 9:48 AM
> To: Jeff Brasen <jbrasen@nvidia.com>; devel@edk2.groups.io
> Cc: Ni, Ray <ray.ni@intel.com>
> Subject: Re: [edk2-devel] [PATCH]
> MdeModulePkg/NonDiscoverablePciDeviceDxe: Add NULL pointer check
> 
> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
> 
> Best Regards,
> Hao Wu
> 
> > -----Original Message-----
> > From: Jeff Brasen <jbrasen@nvidia.com>
> > Sent: Saturday, September 12, 2020 1:17 AM
> > To: devel@edk2.groups.io
> > Cc: Wu, Hao A <hao.a.wu@intel.com>; Ni, Ray <ray.ni@intel.com>; Jeff
> > Brasen <jbrasen@nvidia.com>
> > Subject: [PATCH] MdeModulePkg/NonDiscoverablePciDeviceDxe: Add NULL
> > pointer check
> >
> > Add check for NULL HostAddress in AllocateBuffer as required by UEFI
> > specification.
> >
> > Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
> > ---
> >  .../NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c  | 4
> > ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git
> > a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverable
> > PciDeviceIo.c
> > b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverable
> > PciDeviceIo.c
> > index a40c1a9593..363c4a765b 100644
> > ---
> > a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverable
> > PciDeviceIo.c
> > +++
> > b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverable
> > Pc
> > +++ iDeviceIo.c
> > @@ -856,6 +856,10 @@ CoherentPciIoAllocateBuffer (
> >      return EFI_UNSUPPORTED;   } +  if (HostAddress == NULL) {+    return
> > EFI_INVALID_PARAMETER;+  }+   if ((MemoryType != EfiBootServicesData)
> > &&       (MemoryType != EfiRuntimeServicesData)) {     return
> > EFI_INVALID_PARAMETER;--
> > 2.25.1
> 
> 
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-18  2:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-11 17:16 [PATCH] MdeModulePkg/NonDiscoverablePciDeviceDxe: Add NULL pointer check Jeff Brasen
2020-09-15  1:47 ` Wu, Hao A
2020-09-18  2:47   ` [edk2-devel] " Wu, Hao A

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox