Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3997758pxu; Mon, 12 Oct 2020 07:01:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyM+FWalLqq/PBqUAmTx40YJxUL/14mUcf8UXIXBltEwqhDURGMXpXedEr5DTPkkKpZp4Kw X-Received: by 2002:a5d:684d:: with SMTP id o13mr32326803wrw.302.1602511275776; Mon, 12 Oct 2020 07:01:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602511275; cv=none; d=google.com; s=arc-20160816; b=IvDWrqgpLYriGb3JLGYYLvqDXeildP+N7CW+3TYTi1880u1Kpr0iBtyNOGPCdGAEMN UDXci4nnb+xJVHjQ59Q9k3eTBiWyTvmjlQ8nKVqfgpnRkdH5ba42zcPcHf/1jPalutjd l0T2S/rvHhnlQeQxAvUpB0pMyH1q61NUYWxRj1UT0J/H0H7pT/MPZiYce0ve7epa34CP QGa3KpqT0wMdauJljuC6Rga3FF9CJf4hxCVULYkU8kEZ067G5num4Wm+6JqbeXgufnPa azgvHyBITCZQgO3bYOadFC9GiTv91D/+Ue+P3nj5Iwt+4jKU6QQN8Ey+5aZGTWYwCSTJ ef+A== 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=lJVIBjAcX4lGI4yNhOSrqZoNpCS6oEbTcCHPGCWXEiQ=; b=Dj2WzsMDJMy9cqtaEt+50EtxfP9HftBjC7LndptyzohZG/5FWT556LtRxi3cSt9qml nnfCqHKlx2KiQ9sbiq304eIw2DvY45dQAY/Mug6sFWgS0RltT0hY1F3RbHU9PosUhnob 0wrUVWZuwT0h+vNHDDdBcGe9Em/vJUUKCkC0u9zE9kJvcY5vICyShRcWozIaY2jupUkR Nr9yjyp5Ub+ANmMaGjmGo6yjRme6WCjEUy+us6cr/Y1/tjcwnK4WLMALyd88Fe889fHr 3Zrp9ievt5RRsueUhUSUumNKnohOjqOeQIAnGoiNoZL8aR0otG7pWW4IB/lMUCq0fKQz Td+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UyreKtPS; 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 w16si12324194ejn.471.2020.10.12.07.00.51; Mon, 12 Oct 2020 07:01:15 -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=UyreKtPS; 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 S2390536AbgJLN45 (ORCPT + 99 others); Mon, 12 Oct 2020 09:56:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:49296 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389404AbgJLNnt (ORCPT ); Mon, 12 Oct 2020 09:43:49 -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 9A9C120878; Mon, 12 Oct 2020 13:43:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602510229; bh=xfPx18DR1Yo1IeyBOmicVze493qZfk5VFd3DR5Muv9U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UyreKtPSM/0Zd8PC4/YIWo3Gxnvd5EUbtpL/Zx5ShNbLVF9Uzozo7yRYGqNZGfXcQ JcF/dZDqFKrbygWvO1An6nxeyVP1Ht+K0461KJdp6WkT/lkngsPj8il0nOGhdIIoYg 6iJpKNK9DzYwEfJSWX8Npw9a2lrCvgOcLPjgKUTU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Karol Herbst , dri-devel , Dave Airlie Subject: [PATCH 5.8 010/124] drm/nouveau/mem: guard against NULL pointer access in mem_del Date: Mon, 12 Oct 2020 15:30:14 +0200 Message-Id: <20201012133147.350119703@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: Karol Herbst commit d10285a25e29f13353bbf7760be8980048c1ef2f upstream. other drivers seems to do something similar Signed-off-by: Karol Herbst Cc: dri-devel Cc: Dave Airlie Cc: stable@vger.kernel.org Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20201006220528.13925-2-kherbst@redhat.com Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/nouveau/nouveau_mem.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/gpu/drm/nouveau/nouveau_mem.c +++ b/drivers/gpu/drm/nouveau/nouveau_mem.c @@ -176,6 +176,8 @@ void nouveau_mem_del(struct ttm_mem_reg *reg) { struct nouveau_mem *mem = nouveau_mem(reg); + if (!mem) + return; nouveau_mem_fini(mem); kfree(reg->mm_node); reg->mm_node = NULL;