Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A49E7C7618D for ; Thu, 6 Apr 2023 13:58:51 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 01AA48601D; Thu, 6 Apr 2023 15:58:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="dZlEoEia"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 644108601D; Thu, 6 Apr 2023 15:58:46 +0200 (CEST) Received: from mail-yw1-x112e.google.com (mail-yw1-x112e.google.com [IPv6:2607:f8b0:4864:20::112e]) (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 174D885DD7 for ; Thu, 6 Apr 2023 15:58:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-yw1-x112e.google.com with SMTP id 00721157ae682-536af432ee5so741792447b3.0 for ; Thu, 06 Apr 2023 06:58:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; t=1680789521; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=B7lOr+a22rl5ZPB73fGhp4fOQiR/2P96yZVPJHsGqT0=; b=dZlEoEiapocOaJs4hSXBggmou9V7TzFbBqHRMp6o0oV2ambp08KjMYZ0FAoChdi+2c HVJvm99zO/rrI6EBV5qcunGSNDl1YVOg/xgLbsritfSZJk1h+pjXRdyfkE/bXbHKuD0u 6FOuKjB8ANo/NKewPN2ltV2P7b0KtmwAKih7k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680789521; 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=B7lOr+a22rl5ZPB73fGhp4fOQiR/2P96yZVPJHsGqT0=; b=TgYeMK2h19gszC1mVy8nVj0Pl32gn2VFBMdNgI8J1LwONAOCdabBOP9fSmQxEZBMBO QBhkIfws3VIti3Gisrny1vPjd5NR/LsaACHC74duroG6L32ZC6Fy0n0kQGoj11L4ksvB qSg4Zo0Z5kUSsW9Vb9eund+loFX+l3oTRnljZigs3FYKEXBjSCcWDLr0ZY/WjlzGxymi yNpXyk97GH8vvXwjEgZRQg+G8PDg6bOtxHnDb1OynBRx285USz7krZFORvolp7UaUKFI QeNoZ7FlN1V/1lDP2H4UXuN2nJ0rpPTDHv1bRlb6FZ+JJoMgpu3S6l/WmbzRawIuep/2 /+Qg== X-Gm-Message-State: AAQBX9dI/49mXirkl2rPJBM6Arz3JVQ4fL9lGcI90IIPJBDUeeKbvp6y jQ2uM5VNGC1ZIZEaB4IOOC0l5Fykxbne1TTx1/kKeg== X-Google-Smtp-Source: AKy350bS6Plac7zu7q+8btdVVulMnlhAMNGflYBzdY078B57vpaaL1Cla0+TZBoRJ+er7YRMCfIuLQ== X-Received: by 2002:a81:91d0:0:b0:54c:ad4:a4a7 with SMTP id i199-20020a8191d0000000b0054c0ad4a4a7mr1980207ywg.11.1680789521745; Thu, 06 Apr 2023 06:58:41 -0700 (PDT) Received: from bill-the-cat.lan (2603-6081-7b00-6400-acff-1005-f218-7c24.res6.spectrum.com. [2603:6081:7b00:6400:acff:1005:f218:7c24]) by smtp.gmail.com with ESMTPSA id 5-20020a810905000000b0054c0a8ceb2fsm325480ywj.28.2023.04.06.06.58.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Apr 2023 06:58:41 -0700 (PDT) From: Tom Rini To: u-boot@lists.denx.de Cc: Tuomas Tynkkynen , Sughosh Ganu , Simon Glass Subject: [PATCH] qemu: dfu: Correct memset call in set_dfu_alt_info Date: Thu, 6 Apr 2023 09:58:40 -0400 Message-Id: <20230406135840.1529325-1-trini@konsulko.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 When building with clang, we see: board/emulation/common/qemu_dfu.c:51:24: warning: 'memset' call operates on objects of type 'char' while the size is based on a different type 'char *' [-Wsizeof-pointer-memaccess] As we're calling memset with the length set to the size of the pointer and not the size of the buffer. Correct this with a call of the size of the buffer itself. Signed-off-by: Tom Rini --- Cc: Tuomas Tynkkynen Cc: Sughosh Ganu Cc: Simon Glass --- board/emulation/common/qemu_dfu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/emulation/common/qemu_dfu.c b/board/emulation/common/qemu_dfu.c index 332d659c1f7c..7e7d84f6c00f 100644 --- a/board/emulation/common/qemu_dfu.c +++ b/board/emulation/common/qemu_dfu.c @@ -48,7 +48,7 @@ void set_dfu_alt_info(char *interface, char *devstr) env_get("dfu_alt_info")) return; - memset(buf, 0, sizeof(buf)); + memset(buf, 0, DFU_ALT_BUF_LEN); /* * Currently dfu_alt_info is needed on Qemu ARM64 for -- 2.34.1