Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1287689ybl; Thu, 12 Dec 2019 12:43:18 -0800 (PST) X-Google-Smtp-Source: APXvYqw8an4D4a0G1/HoSQlYRYIe3HORW6uS+qRYqG+gKNf2TjCaE2qAG9KthF92KqX/arQxHLi0 X-Received: by 2002:a9d:7586:: with SMTP id s6mr10140926otk.342.1576183397880; Thu, 12 Dec 2019 12:43:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576183397; cv=none; d=google.com; s=arc-20160816; b=PVowXBIpOIG4Mwoyml+odQiosgN2Xy03sXyVnoBQITnnPJJloI1n0WBDDeeGBPBqSa bcz70V9UHy3kHDFDc1u9nuJ3cLfK/JtLz5TPqah/ltrfImtaQD9aZq1jFSAQqUnhfU+y 0aPh/ieo3yvxDX9inugdfUBjziV+dBNjYnTKkTOjBYljnGwuddgh2jyp44dMlRx1QwrZ PK+7R749Ttru7U1QiUMK06N3T/YQ1HKm03O+64IVDBgP53DrWjj8HPaemo8j5AVf5vzM fKAsM74jwR8YNB1Q37Wn1qA902zt4SjHvtFP1fucHmp1lhuV27aIuBze1r3swX/SHrEB m0zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:subject:user-agent:message-id :references:cc:in-reply-to:from:to:content-transfer-encoding :mime-version; bh=2ti3pGCCysR1JYW2zk5U0yJXDXXyP4PwDVEqIsDULpg=; b=oKTAkxfcVi9+f2Hr/1vav2E3yZOjzsI+jXMsP65ct8SN6ctyLU/4Djag/NnBosBNQE zPGkm1MLa5ym1sokOy3SvT9voDr5Q7xBuiDTD1vnu71tpCcQjSR4ilMpP7jYa81inKD0 YgBm3Vhg1t//l9/Sahy+s14oHGmi6ZZ6/Z2bzBdpLAW8NvzRWCxMLXiL1ie5YhowPbEP xY25+dVE6lFu4cLAIy56lN7ozyhfuiE/3ZbM7TFAM6u93ugxKex4+8QmPVidzkFFU/y/ qkTAZ1JDJmqhjZ4fzNCXqtxCBqBSMYopkXYakvjVnXuMa6SXSvVqvhkN9yHbqj97S6ba Xg4w== 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 21si4189854otv.227.2019.12.12.12.43.04; Thu, 12 Dec 2019 12:43:17 -0800 (PST) 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 S1730844AbfLLUjF convert rfc822-to-8bit (ORCPT + 99 others); Thu, 12 Dec 2019 15:39:05 -0500 Received: from mail.fireflyinternet.com ([109.228.58.192]:52548 "EHLO fireflyinternet.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726814AbfLLUjF (ORCPT ); Thu, 12 Dec 2019 15:39:05 -0500 X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Received: from localhost (unverified [78.156.65.138]) by fireflyinternet.com (Firefly Internet (M1)) with ESMTP (TLS) id 19560382-1500050 for multiple; Thu, 12 Dec 2019 20:38:54 +0000 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT To: Colin Ian King From: Chris Wilson In-Reply-To: <1d2c3c9d-5f11-db41-68ef-61ff9ec601cb@canonical.com> Cc: Venkata Sandeep Dhanalakota , intel-gfx , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" References: <1d2c3c9d-5f11-db41-68ef-61ff9ec601cb@canonical.com> Message-ID: <157618313562.7396.11949995525623174493@skylake-alporthouse-com> User-Agent: alot/0.6 Subject: re: drm/i915: Use the i915_device name for identifying our, request fences Date: Thu, 12 Dec 2019 20:38:55 +0000 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Colin Ian King (2019-12-12 19:53:33) > Hi, > > Static analysis with Coverity has picked up an issue with the following > commit: > > commit 65c29dbb19b2451990c5c477fef7ada3b8218f05 > Author: Chris Wilson > Date: Wed Dec 11 15:02:04 2019 +0000 > > drm/i915: Use the i915_device name for identifying our request fences > > In source drivers/gpu/drm/i915/i915_request.c and function > i915_fence_get_timeline_name there is the following: > > return to_request(fence)->gem_context->name ?: "[" DRIVER_NAME "]"; > > However name is an array: char name[TASK_COMM_LEN + 8], so it can never > be null, so the ternary operator will always return name and will never > reaturn "[" DRIVER_NAME "]". Should it instead be checking if name[0] > is '\0' instead? It's older than that patch, we made it a char[] some time ago. There's a patch pending to make it conditional on ce->gem_context instead. -Chris