From patchwork Fri Feb 7 12:43:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 11370401 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9E815139A for ; Fri, 7 Feb 2020 12:44:02 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7D8F820715 for ; Fri, 7 Feb 2020 12:44:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="A3A8eJfs" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7D8F820715 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D56116FC6F; Fri, 7 Feb 2020 12:43:58 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by gabe.freedesktop.org (Postfix) with ESMTPS id 438196FC6F for ; Fri, 7 Feb 2020 12:43:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581079437; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc; bh=/runWZY2kWww40/PYPKpoZtN7XMh1Bf5TMeaBp+f1iE=; b=A3A8eJfskMtLTFC73YOacXFsHnXHoR8RGzm/dvmNr09b3k5+EayPxsfa/+z3xNl8q1Fka1 Snc1JoC27SshwKvx+OMKqQZV5TrKZUsBgu8O7qCZNllLSORyPxQncFrLwCzSmzrPay2ius jBLW5cGYwA9KDdx4+PIZi4mwH310fkI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-232-a3Y7QnfzMUSfPwuriaC8SQ-1; Fri, 07 Feb 2020 07:43:53 -0500 X-MC-Unique: a3Y7QnfzMUSfPwuriaC8SQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BFC9D800E21; Fri, 7 Feb 2020 12:43:51 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-112.ams2.redhat.com [10.36.116.112]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0957360BEC; Fri, 7 Feb 2020 12:43:48 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 33E42A1E0; Fri, 7 Feb 2020 13:43:48 +0100 (CET) From: Gerd Hoffmann To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/bochs: deinit bugfix Date: Fri, 7 Feb 2020 13:43:48 +0100 Message-Id: <20200207124348.21641-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , open list , Gerd Hoffmann , "open list:DRM DRIVER FOR BOCHS VIRTUAL GPU" MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Check whenever mode_config was actually properly initialized before trying to clean it up. Signed-off-by: Gerd Hoffmann Reviewed-by: Daniel Vetter --- drivers/gpu/drm/bochs/bochs_kms.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/bochs/bochs_kms.c b/drivers/gpu/drm/bochs/bochs_kms.c index cc93ff74fbd8..3a755c911342 100644 --- a/drivers/gpu/drm/bochs/bochs_kms.c +++ b/drivers/gpu/drm/bochs/bochs_kms.c @@ -164,6 +164,9 @@ int bochs_kms_init(struct bochs_device *bochs) void bochs_kms_fini(struct bochs_device *bochs) { + if (!bochs->dev->mode_config.num_connector) + return; + drm_atomic_helper_shutdown(bochs->dev); drm_mode_config_cleanup(bochs->dev); }