From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:40919 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933454AbcILPa6 (ORCPT ); Mon, 12 Sep 2016 11:30:58 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eric Anholt Subject: [PATCH 4.7 24/59] drm/vc4: Fix oops when userspace hands in a bad BO. Date: Mon, 12 Sep 2016 17:29:44 +0200 Message-Id: <20160912152129.790285283@linuxfoundation.org> In-Reply-To: <20160912152128.765864031@linuxfoundation.org> References: <20160912152128.765864031@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: stable-owner@vger.kernel.org List-ID: 4.7-stable review patch. If anyone has any objections, please let me know. ------------------ From: Eric Anholt commit 552416c146fadc67cd9b53ef7adf88d3381c43a6 upstream. We'd end up NULL pointer dereferencing because we didn't take the error path out in the parent. Fixes igt vc4_lookup_fail test. Signed-off-by: Eric Anholt Fixes: d5b1a78a772f ("drm/vc4: Add support for drawing 3D frames.") Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/vc4/vc4_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/gpu/drm/vc4/vc4_gem.c +++ b/drivers/gpu/drm/vc4/vc4_gem.c @@ -575,7 +575,7 @@ vc4_cl_lookup_bos(struct drm_device *dev fail: drm_free_large(handles); - return 0; + return ret; } static int