Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3936969imm; Mon, 8 Oct 2018 11:59:34 -0700 (PDT) X-Google-Smtp-Source: ACcGV62uNBEes++vArGEmAPU0SbRu2EQ6VzdAVf9Sp00VkRneVKn0jt+sBzrOMUUawfYe2hMxbw/ X-Received: by 2002:a63:65c7:: with SMTP id z190-v6mr22345798pgb.146.1539025174409; Mon, 08 Oct 2018 11:59:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539025174; cv=none; d=google.com; s=arc-20160816; b=JRE9jMl2DpgHDZ6b86sPQrKuSKnumXUNOXOWtkCMFSTGlCwuhiQtVAagd/BgFZinh3 F/eNqggKF67nuZp/koSztq6UH25J3HrbxapwtsBqSfDozNRqIm1JwOPq38/XSvWh1ADR umTumLQ8N/YRP7FDIQtoXJinHHRwixYPbG+loqY9Z6F7iFgmnIB5Px2XwWbfKcGpFwC7 4l96rflRL6y3kldNvSzeQT+IOf4S/RGCwPaGLKZ9UqaswJoofoEPKBkl/Bdz+2Q73gDv pZf5L27mAPqCOCDNoukLSolfzBn66uPj+/dunVArX39oOoqpMaz0285x1sFNxtfy6C4a V1Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=iOx32mbNosN1fjzt7rT5OgUQRPy076QTwYr2KC9zRWo=; b=eGGIcpWb7JRvuwCC/z1+aArFn4cd/8Qt8z+tiGYkXb2+WJMaBdQiRDkPG6JYCdlE42 3vrBjfPmNTlsD/4r7kpzKtBAMBeCAZBQvkGjHPpzFqCL5LPXfzxeoH5ApsMP/PGjyTzi i6Vy2w+NCKKFeepOjTrO5nYieCbi30TCQ1pbNvU+O6NzgSdOjQTxV4vH+5UjIxScOa6y vMrpLglcsPfZv6aTDJuwBXa8wLv3+9q8SI/czeE+WtcuFeCjpXdZwLmod8Bc7B2hYIWw 1lEny0hsyDi7VVzY2tR8YSgk2AknaAI+MZUlhh3Jwhw3SK3UZ9NZF8eKuHuqSbMvn+me 0Ogw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BJvAsbzr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q4-v6si16853719pgh.563.2018.10.08.11.59.19; Mon, 08 Oct 2018 11:59:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BJvAsbzr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732205AbeJICEC (ORCPT + 99 others); Mon, 8 Oct 2018 22:04:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:53630 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729987AbeJICEB (ORCPT ); Mon, 8 Oct 2018 22:04:01 -0400 Received: from localhost (ip-213-127-77-176.ip.prioritytelecom.net [213.127.77.176]) (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 2A075204FD; Mon, 8 Oct 2018 18:50:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539024653; bh=EQLoizD/HN2YUSEr4TVAqA+iOv6CiQucWjwa9AuVda4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BJvAsbzrEExdhbzbLL4S2RKlVkBpl3ocJwJKhzEOY5jZJisg9EF8y+yVwcyIwz2/P BBNvQtFc5Gg5gM7kYQ354kgaK6+hdh0nc2s6fkW2tU1PSdeeOdp2XblFqX7ZQMaBCc wnpF6ApSHNWBVcvQxxfTAYXeHuDrTW46D/ff/yds= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ben Skeggs , Sasha Levin Subject: [PATCH 4.18 109/168] drm/nouveau/mmu: dont attempt to dereference vmm without valid instance pointer Date: Mon, 8 Oct 2018 20:31:29 +0200 Message-Id: <20181008175624.188615137@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181008175620.043587728@linuxfoundation.org> References: <20181008175620.043587728@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ben Skeggs [ Upstream commit 51ed833c881b9d96557c773f6a37018d79e29a46 ] Fixes oopses in certain failure paths. Signed-off-by: Ben Skeggs Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c @@ -1423,7 +1423,7 @@ nvkm_vmm_get(struct nvkm_vmm *vmm, u8 pa void nvkm_vmm_part(struct nvkm_vmm *vmm, struct nvkm_memory *inst) { - if (vmm->func->part && inst) { + if (inst && vmm->func->part) { mutex_lock(&vmm->mutex); vmm->func->part(vmm, inst); mutex_unlock(&vmm->mutex);