From patchwork Thu May 18 19:47:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Edwards X-Patchwork-Id: 1783763 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=SqNNjku3; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QN6NN6rbkz20dv for ; Fri, 19 May 2023 22:58:44 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 642DC862DA; Fri, 19 May 2023 14:58:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="SqNNjku3"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 85D9080B98; Thu, 18 May 2023 21:47:39 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3979B84777 for ; Thu, 18 May 2023 21:47:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=cfsworks@gmail.com Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1ae454844edso18339725ad.1 for ; Thu, 18 May 2023 12:47:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684439255; x=1687031255; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=201LhDgC/YS5ydnsdc90Au7DAjlKiMXn020yDo3kb0s=; b=SqNNjku3srSRFsz0W1lxzc6A4EFc5NX2w0MCi3J9VrqmbZUMU8pOHvdZTdanO1dkkj mKftTr3LS04KODvKKVHYJMIt5C/1ItoM8dDIqJSE1pBQpT+kdXYGOE0DWbsDeUm6dSvU Yg+tSunN1jSDZQnB/5C2de6Eh65BOolP19ypoorsxk92eqGq8pWTcWyeSDK25wW1XDsj ui/gk5G1Zrbnx+m5y9gylQnB+w7G90Der10FWRTWtXOCG2Jx1mfME4htyYsnyTm/Igm/ Sg9bEx7DQ/fUtovenphbGvgwj1c7DvFh/XigDx+NQKegUgyRj26qJdGjByy/fHY5c562 FAeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684439255; x=1687031255; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=201LhDgC/YS5ydnsdc90Au7DAjlKiMXn020yDo3kb0s=; b=ehFwFQXGh+9eUjTTLTSsbq3iA+uBpzMks86xzllTcbZsmpDs63qUj+o6NEio/WP1Ha gkiE1LMdPBsP6CFfm49n3zgQjTLcbhmfbZ5RvsiHFoeyKjtomiQ6FdLdg3tfN4s9yaL+ J/a9AQ63NCsgZZ18JcJXPcki8L7L2Chjikh/Fih3aHYCC5QnYWUT1SY1NwGmrM9AN4H/ VQY738QY3SdhqJC03qU70zBhvgOa1Rm0e0wT8NzE7t+FPzj6uffqyvR5uWKda30j7z9E LJ7ldHwPVg0QNQvkJy+at2InG6VSPS0y+HVWbf883JyBkAj5aIWCICpZjTnj1nQ60irA JX6g== X-Gm-Message-State: AC+VfDz3KeclIjFLTvRzuc6h66GMnYq3WIydvb9BjtYMlCILAqf6YU79 B7I2I+I11fmpQwWqXtqw2zpVNBFHoIiNeAia X-Google-Smtp-Source: ACHHUZ6E03ggoYX5AxGl5V/pSncwXvFAlqZBTBFWUW6Ac6p3yMjI06mx8eCdkOelR8den0HU7bRutA== X-Received: by 2002:a17:903:1208:b0:1ae:b38:b6a with SMTP id l8-20020a170903120800b001ae0b380b6amr107887plh.58.1684439255246; Thu, 18 May 2023 12:47:35 -0700 (PDT) Received: from celestia.nettie.lan (static-198-54-134-172.cust.tzulo.com. [198.54.134.172]) by smtp.gmail.com with ESMTPSA id a4-20020a1709027d8400b001a63ba28052sm1850237plm.69.2023.05.18.12.47.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 May 2023 12:47:34 -0700 (PDT) From: Sam Edwards X-Google-Original-From: Sam Edwards To: u-boot@lists.denx.de Cc: Sam Edwards , Jaehoon Chung , Peng Fan Subject: [PATCH] mmc: fix improper use of memset Date: Thu, 18 May 2023 13:47:07 -0600 Message-Id: <20230518194707.63399-1-CFSworks@gmail.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 19 May 2023 14:58:26 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Buffers created through DEFINE_(CACHE_)ALIGN_BUFFER are actually pointers to the real underlying buffer. Using sizeof(...) is not appropriate in this case. Signed-off-by: Sam Edwards Reviewed-by: Peng Fan --- drivers/mmc/mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 1af6af82e6..72c1076c56 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -2262,7 +2262,7 @@ static int mmc_startup_v4(struct mmc *mmc) return 0; if (!mmc->ext_csd) - memset(ext_csd_bkup, 0, sizeof(ext_csd_bkup)); + memset(ext_csd_bkup, 0, MMC_MAX_BLOCK_LEN); err = mmc_send_ext_csd(mmc, ext_csd); if (err)