From patchwork Thu Aug 18 21:02:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 598890 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D485C32789 for ; Thu, 18 Aug 2022 21:11:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346704AbiHRVL0 (ORCPT ); Thu, 18 Aug 2022 17:11:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346864AbiHRVKk (ORCPT ); Thu, 18 Aug 2022 17:10:40 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92CA3D87D1 for ; Thu, 18 Aug 2022 14:05:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=sang-engineering.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=k1; bh=Xp6YlOz6SvcLIVuxxFCMXgW3TF4 P5LCpuNZ1zYJf3gE=; b=u0eaktUD5JKr73PtCHbNRT5xOH0EXt2RKRqQJucZMhp 2w3te+/J3p9EYWZmZLCkhQ+j0IwtYN8M4MY3tuLq8ayhw+nzv7yS9b0Ey0CDJvC7 T0TtVCVh8T+ibUb1o1vGUVc+qpH4jmyCPF6bcvmyu2Xwb9G1qoMsFC87FfuLWzBM = Received: (qmail 3963230 invoked from network); 18 Aug 2022 23:02:23 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 18 Aug 2022 23:02:23 +0200 X-UD-Smtp-Session: l3s3148p1@/e5JTIrmR90ucref From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: Wolfram Sang , Johannes Berg , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH] mac80211: move from strlcpy with unused retval to strscpy Date: Thu, 18 Aug 2022 23:02:23 +0200 Message-Id: <20220818210223.8539-1-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang --- net/mac80211/iface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 95b58c5cac07..e8b9658fe779 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -2267,7 +2267,7 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name, wdev = &sdata->wdev; sdata->dev = NULL; - strlcpy(sdata->name, name, IFNAMSIZ); + strscpy(sdata->name, name, IFNAMSIZ); ieee80211_assign_perm_addr(local, wdev->address, type); memcpy(sdata->vif.addr, wdev->address, ETH_ALEN); ether_addr_copy(sdata->vif.bss_conf.addr, sdata->vif.addr);