From patchwork Mon Feb 12 09:44:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 127957 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp3040207ljc; Mon, 12 Feb 2018 01:45:41 -0800 (PST) X-Google-Smtp-Source: AH8x224d+/toBoKnB7qfjaYLHG3bcWEmzDqXBKgL+xQYmME9rlrTRv5zILNARBXmNLM1dX6TnKt3 X-Received: by 2002:a17:902:46a:: with SMTP id 97-v6mr10029536ple.96.1518428741680; Mon, 12 Feb 2018 01:45:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518428741; cv=none; d=google.com; s=arc-20160816; b=e3i3XeryFQla7m08UmNNFdMF+fYZqoFMgICkC8CC1wNLLWvKaoXg0WegnuXWH9GBoK bwfMx/BqWq0vKvhln864RhIxJVgAoLlobEXhQe08fwP1R81tAQceyLck9mj+70zNMdnA oahsTNxk01qcX4uMSFZrzJp5+fwEhh6s/J2lee6ZVYNorDiEQG7f5WvHq5oz578Pg3Mk U1OgLZg1KJkosZaYlTwXMgyaOlRTK8oR9nWmtkSKY35CBJQ+U0G/sIgXb/k8F9SvUPqq EGE8f/YxESNq/JkNtTXXGbkH0aAWNsb7ri3J5hD0TXGZOIgmYovWiSPpYHUSQ0PoEsPX e36Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:delivered-to :arc-authentication-results; bh=Js8ViUNEksVYeup7J2n6l1KPdc9VCjHS8POpFRgvbNI=; b=PCqXMfVRj20hcNZy9rAwhnc/8ql3EEDOPx+slasPX2k4mBFCDkesDCMQyqWLNjESCi VZbLYEuP9CQyQPk2F86R3qM7xhF/TcTN3VMSTI8iTdOe20fZv3R7N3xJUjw1dlBZpTU9 FdZ4Qh6c8iYqOj6do0oeOdDulM7mDjHfeNCTgF9iVcDtlEo0gx/i5KbTEimrtpbs5zlA vHzodh5jQl1rp2xWz3bDe0qXxk89lR1Qq06aLPmaLh5Hr1XhqpwHoo/dp8xbUitHhjHi jgSeaxDkJG8fKZnzeiOlBD6WXejzYoR+DU4g9+YLtMRXwNqPR3JQP/YVLnANTpHt0OlD FfLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=us3xohYF; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id h1-v6si3850074pln.138.2018.02.12.01.45.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Feb 2018 01:45:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=us3xohYF; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 20E916E10B; Mon, 12 Feb 2018 09:45:08 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from lelnx194.ext.ti.com (lelnx194.ext.ti.com [198.47.27.80]) by gabe.freedesktop.org (Postfix) with ESMTPS id 29E506E10B for ; Mon, 12 Feb 2018 09:45:07 +0000 (UTC) Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelnx194.ext.ti.com (8.15.1/8.15.1) with ESMTP id w1C9j45v007761; Mon, 12 Feb 2018 03:45:04 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1518428704; bh=98H6MP+T2Zac1qtl9lQhxtqOwM/KCmzhaFJl1vYAAj8=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=us3xohYFJgEpzbCLqmu6G19mMMT2763iuieCgfIxWdHXOYKZInX0tC6eVuNmttSaM M59dzknwy6mT5ZYaiAqsTXJmOsjd2VKrRRKFuQIeHj/lybR/TTEgoiGkMeILDo+yV0 /SoJ58AYE6rcS9oSQs9WEg1t1MHeKLJRWxRMY914= Received: from DLEE101.ent.ti.com (dlee101.ent.ti.com [157.170.170.31]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w1C9j42A018084; Mon, 12 Feb 2018 03:45:04 -0600 Received: from DLEE105.ent.ti.com (157.170.170.35) by DLEE101.ent.ti.com (157.170.170.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Mon, 12 Feb 2018 03:45:04 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Mon, 12 Feb 2018 03:45:04 -0600 Received: from deskari.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w1C9j0Mw003439; Mon, 12 Feb 2018 03:45:02 -0600 From: Tomi Valkeinen To: , Laurent Pinchart , Peter Ujfalusi , Jyri Sarha , Benoit Parrot Subject: [PATCH 01/24] drm/omap: fix omap_fbdev_free() when omap_fbdev_create() wasn't called Date: Mon, 12 Feb 2018 11:44:31 +0200 Message-ID: <1518428694-18018-2-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518428694-18018-1-git-send-email-tomi.valkeinen@ti.com> References: <1518428694-18018-1-git-send-email-tomi.valkeinen@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tomi Valkeinen Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" If we have no crtcs/connectors, fbdev init goes fine, but omap_fbdev_create() is never called. This means that omap_fbdev->bo is NULL and omap_fbdev_free() crashes. Add a check to omap_fbdev_free() to handle the NULL case. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/omapdrm/omap_fbdev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/omapdrm/omap_fbdev.c b/drivers/gpu/drm/omapdrm/omap_fbdev.c index 1ace63e2ff22..632ebcf2165f 100644 --- a/drivers/gpu/drm/omapdrm/omap_fbdev.c +++ b/drivers/gpu/drm/omapdrm/omap_fbdev.c @@ -303,7 +303,8 @@ void omap_fbdev_free(struct drm_device *dev) fbdev = to_omap_fbdev(priv->fbdev); /* unpin the GEM object pinned in omap_fbdev_create() */ - omap_gem_unpin(fbdev->bo); + if (fbdev->bo) + omap_gem_unpin(fbdev->bo); /* this will free the backing object */ if (fbdev->fb)