Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4451664imw; Tue, 19 Jul 2022 06:55:22 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vWIjWiLdZMOPj1OvFUrXbS0hZv9x4Pxtww/1urMISOF5kIT0MO9cXO4CgTdYKa59Z7Du32 X-Received: by 2002:a17:906:98c7:b0:72b:20fe:807d with SMTP id zd7-20020a17090698c700b0072b20fe807dmr31394907ejb.75.1658238922667; Tue, 19 Jul 2022 06:55:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658238922; cv=none; d=google.com; s=arc-20160816; b=lH++VPGWXFzmMK6ffGuInVAZHCVCq4/Ris18teBqqxFuP0Za2pmeAp5ZARE3YLcVNb 9Fj+oZgmV0htVQ0d6WESxWWD5lh13G+SOAYiSrLNyT6ASJa0i0tDxDgcE94c2zsETHtx SwFlyjel584PQJDxUH8oJLVBtdWgRJg+IealKjjmiG/MEHYUFQvkxnW9vRMWNziC1iH3 glPKFl79z5IESh/th9JX5ATaL6w5TFmJLR9VLAo4z4vWivjm9ATkMJmy2Ho4ebrnahsO e+gYDxqj5s3RwCGzbZLbUQYpBdyRkMpRktcuXxHOtqHkSS4rL5k8DOgIPeGR+hueE1BE ipQA== 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=OuGhEfHwcqRH4NL96NFYo3JnTDKXVPavbGIcb2LdZ/I=; b=hnHTbl+rOMrVlVL9hsOzRJ6l4Li0Wui66LFRfOE7WjzdgL0KldtGn4ylfVS0UvXFXy tILIxbAUlt2MA5n4bciMHXxyntCVokC6trM9/VhPUic/im1ekh+gRMP5lOj7EUwlCPIw +ojDZfgSXU8WzqVpj5IkmKTy2KvjBm0ffWzXGVtDRI5uGtACG0UgGnB0RSwuUPNJ1jfW g7L/Hodsh6UcttjCniu1ggpBW+RJhVfUdlQwX9oSTDHhGeICIOqQHdpRgbmXWdzoC6cv 5TWrnN30tIJeWy8a/1otYBsAo/fNaRXczcx7tu1rSr/H4B2SMIG25y05TJPapvKiGbKb h/LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IPoCtUbe; 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 sb40-20020a1709076da800b006f445fe1697si4063236ejc.35.2022.07.19.06.54.57; Tue, 19 Jul 2022 06:55:22 -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=IPoCtUbe; 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 S242390AbiGSM5i (ORCPT + 99 others); Tue, 19 Jul 2022 08:57:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242373AbiGSM4p (ORCPT ); Tue, 19 Jul 2022 08:56:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D29E29A6BC; Tue, 19 Jul 2022 05:22:51 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 583E56177D; Tue, 19 Jul 2022 12:22:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 27424C341C6; Tue, 19 Jul 2022 12:22:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658233370; bh=zKIcPj/nHoDO6f2KADrbWiID08iXNMAscwYuS32iCW4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IPoCtUbe8y5f5Jn7gUnUg33+RF1QbLTVn/fWjOy3cBZFRdbjJj2is/7AoSeb942z+ NQiOFY18hTQ28+bU7uPnTmE8y8D+i86rl64ZcaG+Auo5KHd3QfX8YzRVor6Kn8c0h+ jyq0vTJCbZNFWqO8hvptxnhAAxIBJI6s83HI753s= 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.18 100/231] drm/i915/selftests: fix a couple IS_ERR() vs NULL tests Date: Tue, 19 Jul 2022 13:53:05 +0200 Message-Id: <20220719114723.102635040@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220719114714.247441733@linuxfoundation.org> References: <20220719114714.247441733@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 21c29d315cc0..9d42a7c67a8c 100644 --- a/drivers/gpu/drm/i915/gt/selftest_lrc.c +++ b/drivers/gpu/drm/i915/gt/selftest_lrc.c @@ -155,8 +155,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); @@ -331,8 +331,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