Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4373907imw; Tue, 19 Jul 2022 05:34:48 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tdvyt5C4xwgiMlpkkDWDW+eaOnLCbJawusZAVa7jk9BgnT7vxOpQo1y0WH4ZxQmYEtcnEE X-Received: by 2002:a17:906:9b0a:b0:72b:4f33:b247 with SMTP id eo10-20020a1709069b0a00b0072b4f33b247mr30745121ejc.267.1658234088709; Tue, 19 Jul 2022 05:34:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658234088; cv=none; d=google.com; s=arc-20160816; b=HmWCgM17XxmpgPaG0F7oSC3TZ9bmfh2XGGSV5R7jMR4zbiQCB/Fddg0HG+9GXKkAbE Ey0aRwaaJLKbH+YEMHWBs0ZJvN7JGClNTBAHIh0GmJAbJCQ4yPqIdthwZ5VJIhhlDVF3 gnRjjQX2lxaxge0OXvzasIJUmdLvdNaXahzkHpe4u/nrnbdHzItrAiih5o7nfLjkXXNV aORljTFHAbqHCgiW71GBsuYW5EpSscaN7LxyHbWSe6iRBByGjxeoA5oVgkYvGXbgC0nk QPcO5AzGrqDb9XZfWsN1Nrhqk5wAS8DCkvf0RJmt2z3Wug7QvgwhNnhZCKqscbKc2XZJ c37Q== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Tjpn87oQ5va6voxmGS3l5WVE8XwSyM6CJi6UeG4edgg=; b=W9imwqKgCi/zW0etgkU0Njui6POz89rcDe9Yff/L78GEFm6nTW5ObUZFg8sz6FvlIU 8zCrasnhAQI67GHDN5aKuodDbAH+Myv/VdwWyurPnhrPSy4QrLkqwvpSm23peOeWP2+V iZD25M1R1eIHFHdfr/ZrP8Ri3kr7mQbDVLymIP6VJpAHvn3vMvF1Mldblm4eoyznvT/1 s6D0fHF6qCgDBuPT40zivtx+siRdNCEI+/mKI93mgTpybAtc7DeTTv9IbILZGAXjfE/o Fdt0mq1s3OwtQKLxzH1Dd739mSyr4tkCZgmjCfX/wlqJ6yHtnlTKGU9O96lLHeOJhtFw hSzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1GYbN4Mv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qk13-20020a1709077f8d00b0072af3bdf59esi14700523ejc.3.2022.07.19.05.34.24; Tue, 19 Jul 2022 05:34:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1GYbN4Mv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237703AbiGSM1d (ORCPT + 99 others); Tue, 19 Jul 2022 08:27:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239755AbiGSMZo (ORCPT ); Tue, 19 Jul 2022 08:25:44 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D1F761DAF; Tue, 19 Jul 2022 05:09:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8B116B81B2D; Tue, 19 Jul 2022 12:09:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D673AC341E2; Tue, 19 Jul 2022 12:09:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658232560; bh=EGqkbztHD42zX2acGtqzYyknCyUSMbcQHyTg3XsxsDg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1GYbN4Mv2ieTbd7guNLjewmzQf6pZs3ods1uzXjiS+Di0yuK5fX+SBmcXM5VeKEuY bjALhWaND4GNgEuuHy73zaRBMvLmgkm9+p7PV10DtgfEAMkr1fG0Q0FZgDVNq38ZB7 wkBxzYodsMbc7nrBeBN1MDC35accf/Jt4kBYpLPg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Matthew Auld , Rodrigo Vivi , Sasha Levin Subject: [PATCH 5.10 056/112] drm/i915/selftests: fix a couple IS_ERR() vs NULL tests Date: Tue, 19 Jul 2022 13:53:49 +0200 Message-Id: <20220719114631.844638231@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220719114626.156073229@linuxfoundation.org> References: <20220719114626.156073229@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter [ Upstream commit 896dcabd1f8f613c533d948df17408c41f8929f5 ] The shmem_pin_map() function doesn't return error pointers, it returns NULL. Fixes: be1cb55a07bf ("drm/i915/gt: Keep a no-frills swappable copy of the default context state") Signed-off-by: Dan Carpenter Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20220708094104.GL2316@kadam (cherry picked from commit d50f5a109cf4ed50c5b575c1bb5fc3bd17b23308) Signed-off-by: Rodrigo Vivi Signed-off-by: Sasha Levin --- drivers/gpu/drm/i915/gt/selftest_lrc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/selftest_lrc.c b/drivers/gpu/drm/i915/gt/selftest_lrc.c index 95d41c01d0e0..35d55f98a06f 100644 --- a/drivers/gpu/drm/i915/gt/selftest_lrc.c +++ b/drivers/gpu/drm/i915/gt/selftest_lrc.c @@ -4788,8 +4788,8 @@ static int live_lrc_layout(void *arg) continue; hw = shmem_pin_map(engine->default_state); - if (IS_ERR(hw)) { - err = PTR_ERR(hw); + if (!hw) { + err = -ENOMEM; break; } hw += LRC_STATE_OFFSET / sizeof(*hw); @@ -4965,8 +4965,8 @@ static int live_lrc_fixed(void *arg) continue; hw = shmem_pin_map(engine->default_state); - if (IS_ERR(hw)) { - err = PTR_ERR(hw); + if (!hw) { + err = -ENOMEM; break; } hw += LRC_STATE_OFFSET / sizeof(*hw); -- 2.35.1