Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4191876rwd; Tue, 23 May 2023 04:41:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6r6ECQPA2XGHwt7IUfg9ZBjJC2De1ISiOc26YRz55hao8ZuyAqx6HLe8YjcqDcLyBZJJdt X-Received: by 2002:a05:6a00:2daa:b0:64d:746b:b4ec with SMTP id fb42-20020a056a002daa00b0064d746bb4ecmr6913161pfb.17.1684842092063; Tue, 23 May 2023 04:41:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684842092; cv=none; d=google.com; s=arc-20160816; b=K4FeBAZS/K8n7JXv6p6tledXD6eR7j72LjyHF1tVKZIbQUljtAQ0awaEj5uEN3cESF vdv9GKpUp5oGjWVbTw0GiCHswZWFFg7yztmszKZVGDa9pOPN2zYAJ9IfVNEvsig40dZG TRIplxcpt/CJi1YMUnjJLmHzLR2kJ70sqMVfNwjVgjn2HKWUfhuIWg9dvba9OvRvDy7o T4j51IHEuyW3s3xQmV9CQOlSqTpkHBGBuObrJPz5mW3NRLvPpoBoOZEksx/2Lu5gfFmx DJqZq2jfNg/hv97a9Ic6CfYQjmxdgBFWLKqeGF7etFKm2Oz7S89Bt/ImMobo7V6Gh1qV jqeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=IsShx5kUHHQCOr3bTjbAR2yHgoYRKWawCqRxLqgDS2U=; b=bA11IfP8QzqboWwdEUFU6QW3zdKFqsctz18u1BCVEuX4PmL6BHscmfj0wPxR1CXvcA uNfEwuIYQ2Qm4ZXsxDKsBLMcOB0g7XlWhZCtuLZvg7K4I5PBU/9Uoo93JI+w3RPU1Heh sl+PzCSeU7t49OItvLvd9fNFnzA/1my0F3h1CtHFJdBlUk88SjGGhU5sPakMxaGC6F33 Jp+IZb1ajDWT8x5y0FFy7hRPFDG3o/VHjmOflgGxJCuGQcCyjB9sJAuKfn2HT3ghbK6p zF0TqHxp1qOrRgLYPPT4zOKqm/mZWv8kC4dpiBWsBUBxITdb+SHYsRxvY2AzU6OdIEiW UZJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nEZoTThK; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s138-20020a632c90000000b00519e8003677si6200044pgs.664.2023.05.23.04.41.19; Tue, 23 May 2023 04:41:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nEZoTThK; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236457AbjEWLcu (ORCPT + 63 others); Tue, 23 May 2023 07:32:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233339AbjEWLct (ORCPT ); Tue, 23 May 2023 07:32:49 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3E81118; Tue, 23 May 2023 04:32:47 -0700 (PDT) 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 775A7624B1; Tue, 23 May 2023 11:32:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3DEBAC433EF; Tue, 23 May 2023 11:32:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684841566; bh=2bCPs80POr2NdwT8+Ons3d8PhiCamrlaGVRkZrlM6lE=; h=From:To:Cc:Subject:Date:From; b=nEZoTThKhYtXo+kWcB9qgcW7hG6DntBrWl26EKEVW7f2UNh/xaYl+GVOaEFMNaYyu zT1icWzPXXIcx09nmv2q/TC8KBveSSrvv+J5wiq7ne4KgoxoRS93aaYvhsU4wA3IOu jqKkuzItD/fQwDRuniETV2NkioYDDyPHzUc2suFmT8oWydw1Q4MMD/0+ok5aN3/b85 tOc9X3dOwYCkXgr8YyPCXQ7cbLhGrJiSHbWnmfHdZNqfsL2z9ba/Ie8ENqy63GfYT/ rlmwhIujRiV70+h73UN7+KGYqQW/oFLDS/sKCX5UCzW4aAbtWn/QAVaGLhaMi4Pr/I ArlTn3Vw2tf0w== From: Arnd Bergmann To: Ping-Ke Shih , Kalle Valo Cc: Arnd Bergmann , Ching-Te Ku , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] rtw89: use flexible array member in rtw89_btc_btf_tlv Date: Tue, 23 May 2023 13:32:35 +0200 Message-Id: <20230523113241.2772811-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Arnd Bergmann struct rtw89_btc_btf_tlv contains a one-byte member that is intended as a flexible array: In function 'fortify_memcpy_chk', inlined from '_append_tdma' at drivers/net/wireless/realtek/rtw89/coex.c:1579:3: include/linux/fortify-string.h:583:25: error: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning] 583 | __write_overflow_field(p_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Make this actually use a flexible array to let the compiler understand. Signed-off-by: Arnd Bergmann --- drivers/net/wireless/realtek/rtw89/coex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtw89/coex.c b/drivers/net/wireless/realtek/rtw89/coex.c index 3a586a971e8f..bda0e1e99a8c 100644 --- a/drivers/net/wireless/realtek/rtw89/coex.c +++ b/drivers/net/wireless/realtek/rtw89/coex.c @@ -206,7 +206,7 @@ static const struct rtw89_btc_ver rtw89_btc_ver_defs[] = { struct rtw89_btc_btf_tlv { u8 type; u8 len; - u8 val[1]; + u8 val[]; } __packed; enum btc_btf_set_report_en { -- 2.39.2