Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp936155pxj; Fri, 28 May 2021 21:30:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYkV7ajm+PpyE4sIHsrI9KZ7EpTvkHynjASoU4v/uZW7nGtNa2SX0TVkDaKc2pjHEJzchJ X-Received: by 2002:aa7:ca4d:: with SMTP id j13mr13572753edt.158.1622262630850; Fri, 28 May 2021 21:30:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622262630; cv=none; d=google.com; s=arc-20160816; b=IYfyU2iOyH9hvR+y1oHCi/irmycxkOKmgKXOOAVC7YHjbMITLprtBz09H8JZpSmQhv 7NdSeB6RZpAjCyXikBCcTVq4eJByepoNjQObou+1hSXWDUlSey4PVHgJGt9aD/6k/VIN FIWFtSAVkk4HCGod1BT8MPeBPM+3XMEDWIJtMRuhugT6T33L7anNw+/ZEge7vzVMzd3s 6kfCtH5MxoTXg+IVCrCdqAQMDNNoXWQcgFI/f+j5e22AJa7306i8l+60+mpmwr2zn5s0 oobRnvtynnQeL0eUoi63V6Rl3F6P+zyIRUIp8bx0m+BVjHdibYSJxhb2j8jR0jowXvMd UFjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=94hTUqKpg/UNgHQHrMbEdfHIh/uWscVt+QpOuLOkrPE=; b=ZfseDg+vC7Ba/D7ssrsH3Gra2IRgWwNfBnYJCDFIB3mHUzn+W2eBvnEW4uPJgpKfUC ALCp8ZKMp6LtA85alJ6qAQJPXLhAb6RmUn5NowcWfVkUXEkfgwzU0IOcWphpTdQSwamu vv0BQ8njo1VIeG841RdCN2yhePqzp5PT/cE6r4lzpXirX0hsINfodnkg5j183Ar8w9P4 T1aY1/qSkOWZJgtzmG9keqUjGsJvAB970u1ZV0b+K8Zu+22UhXoXLgWNYB8lqHWZUAwt OD06B/EnoDdLTMWSj5TlTrY3DiAeFa6KwyC5+xjZ+5j2gyaZzzDfddYvzQkOuQJ2WnwF gTkg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z9si7154033edi.208.2021.05.28.21.29.53; Fri, 28 May 2021 21:30:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229640AbhE2EZs (ORCPT + 99 others); Sat, 29 May 2021 00:25:48 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:2521 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229549AbhE2EZs (ORCPT ); Sat, 29 May 2021 00:25:48 -0400 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4FsSzm6l7nzYqLw; Sat, 29 May 2021 12:21:24 +0800 (CST) Received: from dggema761-chm.china.huawei.com (10.1.198.203) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Sat, 29 May 2021 12:24:06 +0800 Received: from huawei.com (10.175.127.227) by dggema761-chm.china.huawei.com (10.1.198.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Sat, 29 May 2021 12:24:05 +0800 From: Zhihao Cheng To: , , , , , , CC: , , , , Subject: [PATCH] drm/i915/selftests: Fix return value check in live_breadcrumbs_smoketest() Date: Sat, 29 May 2021 12:33:27 +0800 Message-ID: <20210529043327.2772051-1-chengzhihao1@huawei.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.127.227] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggema761-chm.china.huawei.com (10.1.198.203) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In case of error, the function live_context() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: 52c0fdb25c7c9 ("drm/i915: Replace global breadcrumbs ...") Reported-by: Hulk Robot Signed-off-by: Zhihao Cheng --- drivers/gpu/drm/i915/selftests/i915_request.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/selftests/i915_request.c b/drivers/gpu/drm/i915/selftests/i915_request.c index ee8e753d98ce..eae0abd614cb 100644 --- a/drivers/gpu/drm/i915/selftests/i915_request.c +++ b/drivers/gpu/drm/i915/selftests/i915_request.c @@ -1592,8 +1592,8 @@ static int live_breadcrumbs_smoketest(void *arg) for (n = 0; n < smoke[0].ncontexts; n++) { smoke[0].contexts[n] = live_context(i915, file); - if (!smoke[0].contexts[n]) { - ret = -ENOMEM; + if (IS_ERR(smoke[0].contexts[n])) { + ret = PTR_ERR(smoke[0].contexts[n]); goto out_contexts; } } -- 2.25.4