Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4447057imw; Tue, 19 Jul 2022 06:49:47 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tAY5+DiMbGQwcTJCwtsEHfl5hA1xXMDQi7HVNLeH1gJh6TfWc8kTRofoUkNvR4apFYjaiH X-Received: by 2002:a9d:6455:0:b0:61c:93db:211f with SMTP id m21-20020a9d6455000000b0061c93db211fmr6078553otl.103.1658238587280; Tue, 19 Jul 2022 06:49:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658238587; cv=none; d=google.com; s=arc-20160816; b=z9mGtmcNJW4psVmsIRhVryPHPEbkCn1w3luDz9Aex9Lvfzig0nOAEe7B5WhomKk2QP jjzqfjllT3CbtahGZn0wnL1ZmUZKu9n6fbf+XBP1yz7xkq8eCht5aNAI88YdkQEoNguk xxzRE2lpol9dEbAZ7Ojj8rN/ZH6Str3nEE7HUE2V9kvwn9iYtIzrMN42nugwEw8szXuo 9wEeLtyv3GHE1hU+VGOdK3jCihyzlFAfYdLtmGLmDxLgXuf2BfkIl0VrEsPHho6jfLk4 VWuvtQDr9vUvabnz4+qy9+IslHeyGnM6NtFziLoIxvJ4P6doyisuy/o5IHJVDYsV6Xdr Faow== 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=OPnI/Qq1RRo967hrdCgDRrQTmW/NXPobwFM0n08scV0=; b=bZZ+x6NbWLCIvvolzWXIbpmlxyyhxLVAEdmhNxuAMsEkAF3aAreZ32as7gXy8K3N7n nEYQKPc3wmTTHSVKZFwuqFCIBgEBBPfbwdV6xT4JgCriByIelcqfoCdLPbDjKvF6LDPS I1Bh5jwNko3Y2Ux0F/bnhMf0cYddgQU177vr6V4a0h8Zh4+z8jo/V9q0KQn2xh3VTbde LXL1/pOEXVy3nDi/3WeW3HAY7yD8lpLAXyEWfNJhOv7sko6udL5aZQmZnC/lXf3JvVkg o6rQXnWyhxlEWkbGmsJAUxlfH1b0kriued0BrNjoMhUqfZQdGiKgPdDt6gOnLjkWdlvr CbzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=R3c4hjgc; 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 v6-20020a056870b50600b000f1be2642besi13024573oap.110.2022.07.19.06.49.33; Tue, 19 Jul 2022 06:49:47 -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=R3c4hjgc; 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 S240701AbiGSMh0 (ORCPT + 99 others); Tue, 19 Jul 2022 08:37:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240674AbiGSMgr (ORCPT ); Tue, 19 Jul 2022 08:36:47 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 430AE7B349; Tue, 19 Jul 2022 05:14:17 -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 58C0FB81B08; Tue, 19 Jul 2022 12:14:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C0FDEC341C6; Tue, 19 Jul 2022 12:14:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658232854; bh=4e+egwhf3Xe6mjeGGX+i1VOLzgqkAJAcedV9UkP5Svs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R3c4hjgcZezgZklTnkPWmfTiahkfz6Cnd7+gIaCkiHWLArw44TrfcAkRHqzVwrbdX 1plAwPfOjXgagJdJPOQa06J7n/bfVY5bZZk7ewiir+ygUDiiiz8tKSIMDW3hAKjDW0 23cMRE60x7McYNUy8kpF6CYSGUu6adCIdgvPrzrs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrzej Hajda , Dan Carpenter , Zhenyu Wang , Sasha Levin Subject: [PATCH 5.15 069/167] drm/i915/gvt: IS_ERR() vs NULL bug in intel_gvt_update_reg_whitelist() Date: Tue, 19 Jul 2022 13:53:21 +0200 Message-Id: <20220719114703.173075778@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220719114656.750574879@linuxfoundation.org> References: <20220719114656.750574879@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 e87197fbd137c888fd6c871c72fe7e89445dd015 ] The shmem_pin_map() function returns NULL, it doesn't return error pointers. Fixes: 97ea656521c8 ("drm/i915/gvt: Parse default state to update reg whitelist") Reviewed-by: Andrzej Hajda Signed-off-by: Dan Carpenter Signed-off-by: Zhenyu Wang Link: http://patchwork.freedesktop.org/patch/msgid/Ysftoia2BPUyqVcD@kili Acked-by: Zhenyu Wang Signed-off-by: Sasha Levin --- drivers/gpu/drm/i915/gvt/cmd_parser.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/gvt/cmd_parser.c b/drivers/gpu/drm/i915/gvt/cmd_parser.c index c4118b808268..11971ee929f8 100644 --- a/drivers/gpu/drm/i915/gvt/cmd_parser.c +++ b/drivers/gpu/drm/i915/gvt/cmd_parser.c @@ -3115,9 +3115,9 @@ void intel_gvt_update_reg_whitelist(struct intel_vgpu *vgpu) continue; vaddr = shmem_pin_map(engine->default_state); - if (IS_ERR(vaddr)) { - gvt_err("failed to map %s->default state, err:%zd\n", - engine->name, PTR_ERR(vaddr)); + if (!vaddr) { + gvt_err("failed to map %s->default state\n", + engine->name); return; } -- 2.35.1