Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp984261rwj; Thu, 22 Dec 2022 18:38:49 -0800 (PST) X-Google-Smtp-Source: AMrXdXug64SEWgSsRR9BEt75sncns2S8FAT31LzJLeZ+CPLxMKvSTBGc++lY8Ia4F++1ElvcEnCi X-Received: by 2002:a17:906:1c4e:b0:7c1:1c6:faea with SMTP id l14-20020a1709061c4e00b007c101c6faeamr7714262ejg.75.1671763129740; Thu, 22 Dec 2022 18:38:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671763129; cv=none; d=google.com; s=arc-20160816; b=BFKdHhGJBmjKDxf4QpZig2HgLiX8jJflwIykV70orwpyO/wssbooRBInghrsdXUiMp pTqnLGxEL/dZIhoO6RBn7SRK3mt4eANbfgJK7JaT5/2W4/NTv5VtNrGznIZ2eCq2ylJG yR5owDBwkUFmCzMtByvzSIqrWDAwlmOOkrUdDrtsLvC0eIIz8mpNfPZvgmuEaW5G2/I4 +BAt4HuGV0cRV5iYLSNrZSRjq/PRQQ4/KNlhMHL9H/IG6pexevYYWOhnWZ8znJUO6R1K tOYV1Bq1p2kkLgVMiOf91n9wHzf5PRQAb+hmDeX7kv+rudg5ECZo80DU1EJrqbUkju07 fUig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:mime-version:message-id:date; bh=yuMUiNp0LGjQ5e68J3RY4034x3S2AU59yHPoRc8A1MU=; b=czEiiyZEBmvolvSbv640c2F5hdISOD4YC/xEOyySQG5U8OsYJyQr1VDJLsIfnS2x7h iMLiL1eSb1JriU4LOYeZ1YwlhwjpRfdFP3Nwm1X6+fg4zFPgYIQMwf6yC4+lm13wzSU8 jUFwAMtjn6BPK0KnX22JgqFJ2ME+i+TbyTYGjHpRNrEboUPC8Tra2vX09zxx6FeH3lR3 appu8hee/BrCIJAlhcEV79zZbF/QahFbwx3+xVzQwXJwH8j5DYWqmwHSIdERNNG734hr DZKTZYHfMQ+uuPywi114zYT1jb+bj6Pjzk3kT5ionqz0rEBVsh5bJKy6zLZs0giqcAnS UHzQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hb7-20020a170907160700b007c60482a110si1741375ejc.625.2022.12.22.18.38.33; Thu, 22 Dec 2022 18:38:49 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230444AbiLWCh2 (ORCPT + 66 others); Thu, 22 Dec 2022 21:37:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbiLWCh1 (ORCPT ); Thu, 22 Dec 2022 21:37:27 -0500 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD8801F62A; Thu, 22 Dec 2022 18:37:26 -0800 (PST) Received: from mse-fl1.zte.com.cn (unknown [10.5.228.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4NdWYK3cgSz5PkHg; Fri, 23 Dec 2022 10:37:25 +0800 (CST) Received: from szxlzmapp02.zte.com.cn ([10.5.231.79]) by mse-fl1.zte.com.cn with SMTP id 2BN2bJbl067460; Fri, 23 Dec 2022 10:37:19 +0800 (+08) (envelope-from yang.yang29@zte.com.cn) Received: from mapi (szxlzmapp02[null]) by mapi (Zmail) with MAPI id mid14; Fri, 23 Dec 2022 10:37:21 +0800 (CST) Date: Fri, 23 Dec 2022 10:37:21 +0800 (CST) X-Zmail-TransId: 2b0463a51461ffffffffe8784f89 X-Mailer: Zmail v1.0 Message-ID: <202212231037210142246@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , , , , , , , , , , , , Subject: =?UTF-8?B?W1BBVENIIG5ldC1uZXh0XSBicmNtODAyMTE6IHVzZSBzdHJzY3B5KCkgdG8gaW5zdGVhZCBvZiBzdHJuY3B5KCk=?= Content-Type: text/plain; charset="UTF-8" X-MAIL: mse-fl1.zte.com.cn 2BN2bJbl067460 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.250.138.novalocal with ID 63A51465.000 by FangMail milter! X-FangMail-Envelope: 1671763045/4NdWYK3cgSz5PkHg/63A51465.000/10.5.228.132/[10.5.228.132]/mse-fl1.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 63A51465.000/4NdWYK3cgSz5PkHg X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY 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: Xu Panda The implementation of strscpy() is more robust and safer. That's now the recommended way to copy NUL-terminated strings. Signed-off-by: Xu Panda Signed-off-by: Yang Yang --- drivers/net/wireless/broadcom/brcm80211/brcmsmac/dma.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/dma.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/dma.c index b7df576bb84d..66336c87b0d9 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/dma.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/dma.c @@ -584,8 +584,7 @@ struct dma_pub *dma_attach(char *name, struct brcms_c_info *wlc, rxextheadroom, nrxpost, rxoffset, txregbase, rxregbase); /* make a private copy of our callers name */ - strncpy(di->name, name, MAXNAMEL); - di->name[MAXNAMEL - 1] = '\0'; + strscpy(di->name, name, MAXNAMEL); di->dmadev = core->dma_dev; -- 2.15.2