From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web10.9149.1678353545361157804 for ; Thu, 09 Mar 2023 01:19:05 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FfgZLrE/; spf=pass (domain: kernel.org, ip: 139.178.84.217, mailfrom: ardb@kernel.org) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BA04261AB3 for ; Thu, 9 Mar 2023 09:19:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2053BC433A1 for ; Thu, 9 Mar 2023 09:19:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678353544; bh=1i0PBIdxeW6z+jBHCIyEF8Ile15OPloO4qP6UPjgJhs=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=FfgZLrE/O5EwWjZBeIuOACV944t/mz8uRpVITapm2DTHAfU6b4yl3yz0psfUdVfHR ZggOQwvpCGVbB2PBlmFj+GMT0zC170oxCI/L8Bt332a6hLVwB3oPgCgb0GxeJdzMjq d3kXdF+IDxGBbM/Fbz2cuUmael96qTw9MJNo4PN7cGS8Pfu2Jwi+enoZrlW1/X5mCw 8zi78FjC9PE6DBuVMCX55AQnmiX9/cODkXHlETPVYifiDPfNacTBGXIQI/NYELmFNY 5SeJpTpqyGs797Vumkjvc79YmWzz9UsA7c9YAwL8cEzjKDda0XwncvlcgfT+IA16os rCR20isqrm8FQ== Received: by mail-lj1-f176.google.com with SMTP id z5so1119349ljc.8 for ; Thu, 09 Mar 2023 01:19:04 -0800 (PST) X-Gm-Message-State: AO0yUKWl/EQP2KPa/GuTpQZFfrWx9YTausk/rMS6hTq7bPVDAGZMmE/0 32zQoKYZ7xOYugBPtKC7pTlFtXREOSl9kPbvR+k= X-Google-Smtp-Source: AK7set9u7b0Mfh0U/p4s3dZ0+zc3h0Uvcfv+c0pmNXY+0uU2B9Kk7q5uQLsMH/YOoPO1+rCTw4Tm0OYGOgZ1mAlQFfo= X-Received: by 2002:a2e:a228:0:b0:295:8918:9d77 with SMTP id i8-20020a2ea228000000b0029589189d77mr6576079ljm.2.1678353542068; Thu, 09 Mar 2023 01:19:02 -0800 (PST) MIME-Version: 1.0 References: <20230215143732.676580-1-kraxel@redhat.com> <20230309091636.5kk3hlysdirhfyrh@sirius.home.kraxel.org> In-Reply-To: <20230309091636.5kk3hlysdirhfyrh@sirius.home.kraxel.org> From: "Ard Biesheuvel" Date: Thu, 9 Mar 2023 10:18:50 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/1] ArmPkg/SemihostFs: replace SetMem with ZeroMem To: Gerd Hoffmann Cc: devel@edk2.groups.io, Oliver Steffen , Sami Mujawar , Leif Lindholm , Ard Biesheuvel , Pawel Polawski , Jeremy Boone Content-Type: text/plain; charset="UTF-8" On Thu, 9 Mar 2023 at 10:16, Gerd Hoffmann 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 > > Signed-off-by: Gerd Hoffmann > > --- > > 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 > > > > -- >