Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp241244imm; Thu, 12 Jul 2018 18:26:17 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdLxq/v5U6cSH0LQym3dwmTC2eeheEQCSDbAQorHXChw7AvFmA5GkbyQzZhXlLimSlL7wdH X-Received: by 2002:a62:1e81:: with SMTP id e123-v6mr4754758pfe.188.1531445177360; Thu, 12 Jul 2018 18:26:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531445177; cv=none; d=google.com; s=arc-20160816; b=OfeGoG4Q+c6vS6gLr7P/UQTpf3M3PMvY6dxNLH/aAM5zKa1dd8/fVYgfiWuWzD6mZE AEvuFGpcFlyXeIHSdHaAdkjwOctz1h0ECJshki5qikIOaKt2rBp5PZV6uCuEx9jZvV1k 36D6m2JWhjz04B97jQBD+CH+3po0eTOnO9kF2bGWtEcXIK/fB6cZe0sE6gTuup+HZny1 /9n5yHjESdLaFkA2v22yPNAPZ3rR9x9t4rfWZF96ic+d7+c/0R4NYSeWr41f2cEKs+eZ phVy8fEKNnKnl9daqeZIs6nRtgOJL4ArBRNdj0b/WNCUOHghU6bxb9Z6c8xMbohqmLob mnqg== 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=vxQsUY6uH09/Ektql3Tfo4v0V5BVxeZeZvwXaaCxWfQ=; b=c5O5KjSE0tYJO0f7ZrwP0M3JLIWWorlok8rqYmViAIdO+UYPRW0d4xgxAAIK54U21u biAHUxaseX+qogvgqcd7RQQZuwbG7oIfTRafJlfYw7TimPuMSENg4W6o3e1Q/s1L50lT 5RzTh4Lq6/c60SXrJAzL3sqyhuz+1qi1tQj5JrpEUCQEANxhHqs3IbdsoHAoDoMCIvpa tc6IvVDC8dkmFxqAJg07Wbyrxqjf7THNpmMEHN7T/VP/Dq52s1WWZvr7JUTzMuHlhlRx hleuj/mJ/SixS94JjvnEeedUuzQOXHj/vA6U5elWhF8LCXLQPAimq1qJkhzEbwHH6NmK TFJg== 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 3-v6si23291043pla.418.2018.07.12.18.26.02; Thu, 12 Jul 2018 18:26:17 -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 S2387971AbeGMBhd (ORCPT + 99 others); Thu, 12 Jul 2018 21:37:33 -0400 Received: from nautica.notk.org ([91.121.71.147]:42981 "EHLO nautica.notk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387896AbeGMBhd (ORCPT ); Thu, 12 Jul 2018 21:37:33 -0400 Received: by nautica.notk.org (Postfix, from userid 1001) id 82AD9C01C; Fri, 13 Jul 2018 03:25:20 +0200 (CEST) From: Dominique Martinet Cc: Dominique Martinet , Ben Skeggs , David Airlie , dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 04/18] nouveau: change strncpy+truncation to strlcpy Date: Fri, 13 Jul 2018 03:25:19 +0200 Message-Id: <1531445119-19207-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/gpu/drm/nouveau/nvkm/core/firmware.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/core/firmware.c b/drivers/gpu/drm/nouveau/nvkm/core/firmware.c index 058ff46b5f16..579eb17db9f4 100644 --- a/drivers/gpu/drm/nouveau/nvkm/core/firmware.c +++ b/drivers/gpu/drm/nouveau/nvkm/core/firmware.c @@ -40,8 +40,7 @@ nvkm_firmware_get(struct nvkm_device *device, const char *fwname, int i; /* Convert device name to lowercase */ - strncpy(cname, device->chip->name, sizeof(cname)); - cname[sizeof(cname) - 1] = '\0'; + strlcpy(cname, device->chip->name, sizeof(cname)); i = strlen(cname); while (i) { --i; -- 2.17.1