Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1204150imm; Wed, 11 Jul 2018 20:04:54 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdthP//1WwVL2/ZJOYoDAJGtw7SDLch/fBO9NNJdD4RHScCdAflZ52w42/KPGemWnEYeBc+ X-Received: by 2002:a65:6398:: with SMTP id h24-v6mr428538pgv.245.1531364694500; Wed, 11 Jul 2018 20:04:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531364694; cv=none; d=google.com; s=arc-20160816; b=zFxi1wHppfflCDx48pdm9E0wBzOA+pBvSWQ16miVnn0qunWud0f911qwjA04oVRj4o l13weGYxJbLoeHykhn0P4I36+Gp0VHa3akji46oqxIM5HHmCDCjS1KygtbZmpE9ERZwq n43LQItOLZKqHhdOjAVy1s0qSPtXqIcMBkahIw5dmZ5fii9XgxkIEuAzx9PDLBlle/yz HoQlHIpq9gHsEw63dsFDorTGzC2NwmsS7HCmgXtO+xTKEah7HFkPW7NUkS2oqS5Af+rl kv9HA3eJVd03UDO9s570GtMOMsS1gJbNmtP8C0pZHzXRzzwLZQk+XqQ3BxYRzHn9F0DB PCVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=uFjeZe/1B9Wj5KsRONFXJ/hMfbv6nVgz7vaauAf1UT4=; b=MPbqcvjNR7eRWN6aE2a5yxLsVbCUVFDRGKwGTA/GbrmhzBuHeQjtuyekO3jTW8LCQ1 QaFMybaxTukBC3zJQvP/jrHj7/haJ09u63EJbcPBA5dRJpDKyG/LJc3UBn42XeXkW2Ue J5Z7FQod/0eGCuVoJZ4id+PF+5cuWLhu8I6U99p39XASFjr5qoZ1nJr2XmtzgR9v8niM vILC/6VIqRb2iNUhRk6WOtPzEOyu7+hx8+p+0NY+jQn5TnT+lcXeCkZYYBgoicPF7mPp tgd+ueSZANl2CX5er8QIIiNddRerg7MHUEkVjeaK3fTNLwfED0gBGuEwu8AENNBsywY6 Vl1Q== 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 l67-v6si1372836pfl.167.2018.07.11.20.04.39; Wed, 11 Jul 2018 20:04:54 -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 S2403750AbeGKXb4 (ORCPT + 99 others); Wed, 11 Jul 2018 19:31:56 -0400 Received: from nautica.notk.org ([91.121.71.147]:57387 "EHLO nautica.notk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389441AbeGKXb4 (ORCPT ); Wed, 11 Jul 2018 19:31:56 -0400 Received: by nautica.notk.org (Postfix, from userid 1001) id 79080C009; Thu, 12 Jul 2018 01:25:16 +0200 (CEST) From: Dominique Martinet To: Chris Wilson , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi Cc: David Airlie , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Dominique Martinet Subject: [PATCH v2] i915/intel_tv_get_modes: fix strncpy truncation warning Date: Thu, 12 Jul 2018 01:24:46 +0200 Message-Id: <1531351486-5932-1-git-send-email-asmadeus@codewreck.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1531295175-24052-1-git-send-email-asmadeus@codewreck.org> References: <1531295175-24052-1-git-send-email-asmadeus@codewreck.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Change it to use strlcpy instead Signed-off-by: Dominique Martinet --- drivers/gpu/drm/i915/intel_tv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c index b55b5c157e38..25fee7dba7e2 100644 --- a/drivers/gpu/drm/i915/intel_tv.c +++ b/drivers/gpu/drm/i915/intel_tv.c @@ -1355,8 +1355,7 @@ intel_tv_get_modes(struct drm_connector *connector) mode_ptr = drm_mode_create(connector->dev); if (!mode_ptr) continue; - strncpy(mode_ptr->name, input->name, DRM_DISPLAY_MODE_LEN); - mode_ptr->name[DRM_DISPLAY_MODE_LEN - 1] = '\0'; + strlcpy(mode_ptr->name, input->name, DRM_DISPLAY_MODE_LEN); mode_ptr->hdisplay = hactive_s; mode_ptr->hsync_start = hactive_s + 1; -- 2.17.1