public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 1/1] ArmPkg/SemihostFs: replace SetMem with ZeroMem
@ 2023-02-15 14:37 Gerd Hoffmann
  2023-02-15 17:29 ` [edk2-devel] " Rebecca Cran
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Gerd Hoffmann @ 2023-02-15 14:37 UTC (permalink / raw)
  To: devel
  Cc: Oliver Steffen, Sami Mujawar, Leif Lindholm, Ard Biesheuvel,
	Pawel Polawski, Gerd Hoffmann, Jeremy Boone

SetMem arguments 2+3 are in the wrong order, resulting in
the call having no effect because Length is zero.

Fix this by using ZeroMem instead.

Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=4205
Reported-by: Jeremy Boone <jeremy.boone@nccgroup.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c b/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c
index 39a30533ee57..9cc9ed7d3637 100644
--- a/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c
+++ b/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c
@@ -574,7 +574,7 @@ ExtendFile (
   }
 
   Remaining = Size;
-  SetMem (WriteBuffer, 0, sizeof (WriteBuffer));
+  ZeroMem (WriteBuffer, sizeof (WriteBuffer));
   while (Remaining > 0) {
     WriteNb   = MIN (Remaining, sizeof (WriteBuffer));
     WriteSize = WriteNb;
-- 
2.39.1


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

* Re: [edk2-devel] [PATCH 1/1] ArmPkg/SemihostFs: replace SetMem with ZeroMem
  2023-02-15 14:37 [PATCH 1/1] ArmPkg/SemihostFs: replace SetMem with ZeroMem Gerd Hoffmann
@ 2023-02-15 17:29 ` Rebecca Cran
  2023-02-21 14:21 ` Sami Mujawar
  2023-03-09  9:16 ` Gerd Hoffmann
  2 siblings, 0 replies; 5+ messages in thread
From: Rebecca Cran @ 2023-02-15 17:29 UTC (permalink / raw)
  To: devel, kraxel
  Cc: Oliver Steffen, Sami Mujawar, Leif Lindholm, Ard Biesheuvel,
	Pawel Polawski, Jeremy Boone

Reviewed-by: Rebecca Cran <rebecca@bsdio.com>

On 2/15/23 07:37, Gerd Hoffmann wrote:
> SetMem arguments 2+3 are in the wrong order, resulting in
> the call having no effect because Length is zero.
> 
> Fix this by using ZeroMem instead.
> 
> Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=4205
> Reported-by: Jeremy Boone <jeremy.boone@nccgroup.com>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>   ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c b/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c
> index 39a30533ee57..9cc9ed7d3637 100644
> --- a/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c
> +++ b/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c
> @@ -574,7 +574,7 @@ ExtendFile (
>     }
>   
>     Remaining = Size;
> -  SetMem (WriteBuffer, 0, sizeof (WriteBuffer));
> +  ZeroMem (WriteBuffer, sizeof (WriteBuffer));
>     while (Remaining > 0) {
>       WriteNb   = MIN (Remaining, sizeof (WriteBuffer));
>       WriteSize = WriteNb;


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

* Re: [PATCH 1/1] ArmPkg/SemihostFs: replace SetMem with ZeroMem
  2023-02-15 14:37 [PATCH 1/1] ArmPkg/SemihostFs: replace SetMem with ZeroMem Gerd Hoffmann
  2023-02-15 17:29 ` [edk2-devel] " Rebecca Cran
@ 2023-02-21 14:21 ` Sami Mujawar
  2023-03-09  9:16 ` Gerd Hoffmann
  2 siblings, 0 replies; 5+ messages in thread
From: Sami Mujawar @ 2023-02-21 14:21 UTC (permalink / raw)
  To: Gerd Hoffmann, devel@edk2.groups.io
  Cc: Oliver Steffen, Leif Lindholm, Ard Biesheuvel, Pawel Polawski,
	Jeremy Boone, nd

Hi Gerd,

Thank you for this patch.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>

Regards,

Sami Mujawar

On 15/02/2023, 14:37, "Gerd Hoffmann" <kraxel@redhat.com <mailto:kraxel@redhat.com>> wrote:


SetMem arguments 2+3 are in the wrong order, resulting in
the call having no effect because Length is zero.


Fix this by using ZeroMem instead.


Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=4205 <https://bugzilla.tianocore.org/show_bug.cgi?id=4205>
Reported-by: Jeremy Boone <jeremy.boone@nccgroup.com <mailto:jeremy.boone@nccgroup.com>>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com <mailto:kraxel@redhat.com>>
---
ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)


diff --git a/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c b/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c
index 39a30533ee57..9cc9ed7d3637 100644
--- a/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c
+++ b/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c
@@ -574,7 +574,7 @@ ExtendFile (
}


Remaining = Size;
- SetMem (WriteBuffer, 0, sizeof (WriteBuffer));
+ ZeroMem (WriteBuffer, sizeof (WriteBuffer));
while (Remaining > 0) {
WriteNb = MIN (Remaining, sizeof (WriteBuffer));
WriteSize = WriteNb;
-- 
2.39.1






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

* Re: [PATCH 1/1] ArmPkg/SemihostFs: replace SetMem with ZeroMem
  2023-02-15 14:37 [PATCH 1/1] ArmPkg/SemihostFs: replace SetMem with ZeroMem Gerd Hoffmann
  2023-02-15 17:29 ` [edk2-devel] " Rebecca Cran
  2023-02-21 14:21 ` Sami Mujawar
@ 2023-03-09  9:16 ` Gerd Hoffmann
  2023-03-09  9:18   ` Ard Biesheuvel
  2 siblings, 1 reply; 5+ messages in thread
From: Gerd Hoffmann @ 2023-03-09  9:16 UTC (permalink / raw)
  To: devel
  Cc: Oliver Steffen, Sami Mujawar, Leif Lindholm, Ard Biesheuvel,
	Pawel Polawski, Jeremy Boone

Ping.  Two reviews and the freeze is over.  Merge this now?

On Wed, Feb 15, 2023 at 03:37:32PM +0100, Gerd Hoffmann wrote:
> SetMem arguments 2+3 are in the wrong order, resulting in
> the call having no effect because Length is zero.
> 
> Fix this by using ZeroMem instead.
> 
> Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=4205
> Reported-by: Jeremy Boone <jeremy.boone@nccgroup.com>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c b/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c
> index 39a30533ee57..9cc9ed7d3637 100644
> --- a/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c
> +++ b/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c
> @@ -574,7 +574,7 @@ ExtendFile (
>    }
>  
>    Remaining = Size;
> -  SetMem (WriteBuffer, 0, sizeof (WriteBuffer));
> +  ZeroMem (WriteBuffer, sizeof (WriteBuffer));
>    while (Remaining > 0) {
>      WriteNb   = MIN (Remaining, sizeof (WriteBuffer));
>      WriteSize = WriteNb;
> -- 
> 2.39.1
> 

-- 


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

* Re: [PATCH 1/1] ArmPkg/SemihostFs: replace SetMem with ZeroMem
  2023-03-09  9:16 ` Gerd Hoffmann
@ 2023-03-09  9:18   ` Ard Biesheuvel
  0 siblings, 0 replies; 5+ messages in thread
From: Ard Biesheuvel @ 2023-03-09  9:18 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: devel, Oliver Steffen, Sami Mujawar, Leif Lindholm,
	Ard Biesheuvel, Pawel Polawski, Jeremy Boone

On Thu, 9 Mar 2023 at 10:16, Gerd Hoffmann <kraxel@redhat.com> wrote:
>
> Ping.  Two reviews and the freeze is over.  Merge this now?
>

Pong. Thanks for the reminder - I'll go and merge this.

> On Wed, Feb 15, 2023 at 03:37:32PM +0100, Gerd Hoffmann wrote:
> > SetMem arguments 2+3 are in the wrong order, resulting in
> > the call having no effect because Length is zero.
> >
> > Fix this by using ZeroMem instead.
> >
> > Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=4205
> > Reported-by: Jeremy Boone <jeremy.boone@nccgroup.com>
> > Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> > ---
> >  ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c b/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c
> > index 39a30533ee57..9cc9ed7d3637 100644
> > --- a/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c
> > +++ b/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c
> > @@ -574,7 +574,7 @@ ExtendFile (
> >    }
> >
> >    Remaining = Size;
> > -  SetMem (WriteBuffer, 0, sizeof (WriteBuffer));
> > +  ZeroMem (WriteBuffer, sizeof (WriteBuffer));
> >    while (Remaining > 0) {
> >      WriteNb   = MIN (Remaining, sizeof (WriteBuffer));
> >      WriteSize = WriteNb;
> > --
> > 2.39.1
> >
>
> --
>

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

end of thread, other threads:[~2023-03-09  9:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-15 14:37 [PATCH 1/1] ArmPkg/SemihostFs: replace SetMem with ZeroMem Gerd Hoffmann
2023-02-15 17:29 ` [edk2-devel] " Rebecca Cran
2023-02-21 14:21 ` Sami Mujawar
2023-03-09  9:16 ` Gerd Hoffmann
2023-03-09  9:18   ` Ard Biesheuvel

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