Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3989956pxu; Mon, 12 Oct 2020 06:48:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwySXWuO9aA42Fm07etkFPYfSA6WDXZipS6kymZ7vP5sR9JSUAn84FFNEr+XHiRmurtPf/4 X-Received: by 2002:a17:907:10ce:: with SMTP id rv14mr27652689ejb.547.1602510498513; Mon, 12 Oct 2020 06:48:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602510498; cv=none; d=google.com; s=arc-20160816; b=KDwzfH3CMZJlR8bmy0HOr1GrAIHM1aZ2icFCjqdgTxwj2gN1GVrKGmmUYfl6b90dwK C8z/qZc0uAm/lsN+fTreFBqXKxyX6B07EfGs1WYNHDeQ/awR75cwU758VIeWLACwPbec 2C4fxbhjFvx57/zV8vB5kr+1rGZahaLRvgrxjcGCrcp0if6kNWT8S6zTc/cQxOhpz7w0 fB8dTGbLVtev2vurXNWi84nyXpEorosm6gqa7/YU2Bo64fChDeWSkT0wEGnFEZEcNwTx o2AsaCPVklBVghW0A/Vj4s4jgcqh4E8Qbb+JfolqjL1agD0PPtHXu9fiX/VohW+iwWHp 9J0A== 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=LUvINDDqg/my+cP93b8ezWqaXxN0vdWQNJWvtMiUwHw=; b=b7ULdgDhU9Jfxtdw5eXeT5FzGaLMjz55cnqprHgsnYe2SCr2XxjVpd1LG8PxurYjJB nHxRrI7aQg/bhK8vlVwAhJ9ym4/VzdkPljJ+Tt048nEwru4CX27lmj4F1ADl7jxZ2Qo7 QQhLilFNM5nBc9yDF3tgSvnjrfF5czQiicC9aiANNg+197/xO0d03yZ+7A1AZY9kmpE5 h+wJV7iDVN+VFiSfV3nk76u3Lmsxb8/xzxN4WMIETzVBlpMhyMcA/wNzA4K3ntajva7k K/UjSjhZEwZOpzPm7Wr/bWbk2DPyfvNmdj56ylcKn4R8TaaDR+iWufpb1Dt8L9QgTR0I +/AA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fSAGn4jv; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lj15si11516089ejb.612.2020.10.12.06.47.55; Mon, 12 Oct 2020 06:48:18 -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; dkim=pass header.i=@kernel.org header.s=default header.b=fSAGn4jv; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389774AbgJLNqJ (ORCPT + 99 others); Mon, 12 Oct 2020 09:46:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:46218 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389771AbgJLNpz (ORCPT ); Mon, 12 Oct 2020 09:45:55 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7B85D22203; Mon, 12 Oct 2020 13:45:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602510341; bh=EyUHLpJ9aZARAFtXkW2k+HUAixFuRffHWncCUAfMynE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fSAGn4jvE43KR0mhCeNzwNP95jk9kH5Bn96d/zTnBH7mdRSLCcPS6PlhSgzE9wHCa irTJkf6eLsUD6HYatj8i8oq6hkdu9SrcjEHFZj0YoWFJx9ucqfSt6KkAnuEsVRxP41 x4JRX12dkcrIpX1OXaMhrmN1GWCPAM75WIljVtTE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zack Rusin , Roland Scheidegger , Martin Krastev , Sasha Levin Subject: [PATCH 5.8 050/124] drm/vmwgfx: Fix error handling in get_node Date: Mon, 12 Oct 2020 15:30:54 +0200 Message-Id: <20201012133149.276124624@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201012133146.834528783@linuxfoundation.org> References: <20201012133146.834528783@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zack Rusin [ Upstream commit f54c4442893b8dfbd3aff8e903c54dfff1aef990 ] ttm_mem_type_manager_func.get_node was changed to return -ENOSPC instead of setting the node pointer to NULL. Unfortunately vmwgfx still had two places where it was explicitly converting -ENOSPC to 0 causing regressions. This fixes those spots by allowing -ENOSPC to be returned. That seems to fix recent regressions with vmwgfx. Signed-off-by: Zack Rusin Reviewed-by: Roland Scheidegger Reviewed-by: Martin Krastev Sigend-off-by: Roland Scheidegger Signed-off-by: Sasha Levin --- drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_thp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c index 7da752ca1c34b..b93c558dd86e0 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c @@ -57,7 +57,7 @@ static int vmw_gmrid_man_get_node(struct ttm_mem_type_manager *man, id = ida_alloc_max(&gman->gmr_ida, gman->max_gmr_ids - 1, GFP_KERNEL); if (id < 0) - return (id != -ENOMEM ? 0 : id); + return id; spin_lock(&gman->lock); diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_thp.c b/drivers/gpu/drm/vmwgfx/vmwgfx_thp.c index b7c816ba71663..c8b9335bccd8d 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_thp.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_thp.c @@ -95,7 +95,7 @@ found_unlock: mem->start = node->start; } - return 0; + return ret; } -- 2.25.1