Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp241702imm; Thu, 12 Jul 2018 18:27:05 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeJMHXVcIEROmazNAwcXaq28cue7w9JfgZRADfYqiQ9W0M0IBqzIVmpCtSAWKLy+KvYmBHK X-Received: by 2002:a62:828a:: with SMTP id w132-v6mr4780975pfd.121.1531445224968; Thu, 12 Jul 2018 18:27:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531445224; cv=none; d=google.com; s=arc-20160816; b=aTJvKcOA1aEh0XdvJdUfgkm2RjLsh+DtUGrDc6xH2Fe6MkZONFnCzBf6oU3cC2luUB 6G4Zi9b2lVmnSR8e5nDeurwEYSEI9bPep9vwa0uNnU3+Kwi/YEw53aPBUIkg9/O0B1Pb YI+zo0Et2jhPKyzZ5haCkFXaawUR/Qq9E2ftLvi8m6B3awsr/wVNNAM8Na+9I9pTXCgR wUPosfIg4BTD/6B2kUvGBmMsTNrYMGy/oishviSbpKCbAxdU55p7Ee/VXzjmtZ8eDPnd BwmsT4Qja4SidpvmY+wasCYIgC/QkIjSHs3sPwW2Dqk21XbgwLCGZTITNijvMTY47rQq 3ymA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:in-reply-to:message-id:date :subject:cc:from:arc-authentication-results; bh=5jDdmu+pr1FhjulZkh07kzW2huFu5QlHNW+cm094Ios=; b=S7EigYsWj+n82Sq4X4U5l4x0EBW/IlbgSGw+m5zqL7ImZFNXsRKuLBJHfNWpnwXadB CCTX5A4J3Wr9kqqSDLnyT1xPMm2LEiqfsrpRDw341Gh4Z15VgRY97aHQQNbMILcwe+uy smsuvpim0wWm/9uyQ3TLJMWFbXb5RIxe+q6w7N9R1tVqUFoCuXBdFTaUPC5th0V1GzXN r35HEwJcgzI4hO2hdvKv6SCpSzzeE/qMQiecX/62T4OQrQ+ZX955ytzuDjTs09WB3g1H FfwKa4alte54YMPZP3F+gZSvYy03nsFG16hbxJhYl9CDspsvugWY5PIcyc0huHhzACi+ emKA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w3-v6si10244642pgp.220.2018.07.12.18.26.50; Thu, 12 Jul 2018 18:27:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388082AbeGMBiC (ORCPT + 99 others); Thu, 12 Jul 2018 21:38:02 -0400 Received: from nautica.notk.org ([91.121.71.147]:43014 "EHLO nautica.notk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387896AbeGMBiB (ORCPT ); Thu, 12 Jul 2018 21:38:01 -0400 Received: by nautica.notk.org (Postfix, from userid 1001) id 7F84AC023; Fri, 13 Jul 2018 03:25:48 +0200 (CEST) From: Dominique Martinet Cc: Dominique Martinet , Arend van Spriel , Franky Lin , Hante Meuleman , Chi-Hsien Lin , Wright Feng , Kalle Valo , "David S. Miller" , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, brcm80211-dev-list@cypress.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 10/18] brcmsmac: change strncpy+truncation to strlcpy Date: Fri, 13 Jul 2018 03:25:47 +0200 Message-Id: <1531445147-19566-1-git-send-email-asmadeus@codewreck.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1531444483-17338-1-git-send-email-asmadeus@codewreck.org> References: <1531444483-17338-1-git-send-email-asmadeus@codewreck.org> To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Generated by scripts/coccinelle/misc/strncpy_truncation.cocci Signed-off-by: Dominique Martinet --- Please see https://marc.info/?l=linux-kernel&m=153144450722324&w=2 (the first patch of the serie) for the motivation behind this patch 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..58ccd72d672c 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'; + strlcpy(di->name, name, MAXNAMEL); di->dmadev = core->dma_dev; -- 2.17.1