Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp819905imc; Sun, 10 Mar 2019 23:23:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqxp+b7x/ItFFHCcM1+Q1o3TjSoDxEcXQOI6Gd+wZVJu9C5C9vtnc1f8B1vnrAbkYUyuMGl4 X-Received: by 2002:a17:902:2a89:: with SMTP id j9mr33204830plb.28.1552285380723; Sun, 10 Mar 2019 23:23:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552285380; cv=none; d=google.com; s=arc-20160816; b=FD8BuPCzlKYvMwA/RCD1nKQzR/re1T29VK+InOdr89vBCRugmgKXDH4oBaQm9t8zxe o+HhbGkKXddzvSr00oqvLWeWdm753X8yZUNio20qHaECuR5XEFG3i+5MRmHIOySzYIVd S5yCTp5SMszCzV82sffFl1cZL0SghjIvCJdZ9lt/h4NLbgFOoC5WZBphVFelTstiAe0u oy4sa2vgftBHvb0Vlo047k46wdjxqLLG2kxFYShTh/OCnmJd5/neZGW0fTqWc974GhYO yqrH9Vcv4QFPzPuoqulYlN4jG4Rbdwxgpfw/JBNY7MCl6E9OeECL/87nIErlqozjM0ud Z8LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=VZyfikU11lWGOd3zzaeIMhuwJ+ou4zZf5/xa6xtVGuM=; b=AbsgfcZe5x9VTKAtbX7DIpOFES08i3h/Nlgx6Ml2GXCZ5eMSYEp1P/3OxNQwxu2Z+F lrN5YSuIu0MudCC4fB5OtE0jsuw6gvcHANh2DUmjkWoE/r5rDD1xeT2DVOo5rPNoMKdA 0e0K+cIUxSXF2pykiP2pGkWxkOc4n7fMIEeK0wivf3iFEXuChADOAFRhM/Pbe2PU6188 uLIanLq9nHcFDr17GLZr+JNfxdtRer68yQri5LsmyelvCIokwG8gNqBsuHKsuz14KZ00 Oh3o/KI2YnEJFdfTlHJXaVpXBAjaby730hoBUW2J5Gsi/sxZ00Hboa91gAoraqTL+jUF Pt2A== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w8si1018417ply.303.2019.03.10.23.22.45; Sun, 10 Mar 2019 23:23:00 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726600AbfCKGWC (ORCPT + 99 others); Mon, 11 Mar 2019 02:22:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58792 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725850AbfCKGWB (ORCPT ); Mon, 11 Mar 2019 02:22:01 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 889A53082AF4; Mon, 11 Mar 2019 06:22:01 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-211.ams2.redhat.com [10.36.116.211]) by smtp.corp.redhat.com (Postfix) with ESMTP id 151905D70E; Mon, 11 Mar 2019 06:22:00 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 073BB11A9A; Mon, 11 Mar 2019 07:22:00 +0100 (CET) Date: Mon, 11 Mar 2019 07:22:00 +0100 From: Gerd Hoffmann To: Rodrigo Siqueira Cc: David Airlie , Daniel Vetter , virtualization@lists.linux-foundation.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/bochs: Fix NULL dereference on atomic_disable helper Message-ID: <20190311062200.4mtel3j5fjxtxrcf@sirius.home.kraxel.org> References: <20190310212150.xhhb4abzm7j3ain2@smtp.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190310212150.xhhb4abzm7j3ain2@smtp.gmail.com> User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Mon, 11 Mar 2019 06:22:01 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Mar 10, 2019 at 06:21:50PM -0300, Rodrigo Siqueira wrote: > When the subtest basic-plain-flip from IGT project was executed on Bochs > driver, the following bug appears: > > BUG: unable to handle kernel NULL pointer dereference at 0000000000000000 > ? drm_atomic_helper_commit_modeset_disables+0x396/0x3e0 [drm_kms_helper] > +static void bochs_crtc_atomic_disable(struct drm_crtc *crtc, > + struct drm_crtc_state *old_state) > +{ > +} > + > static void bochs_crtc_atomic_flush(struct drm_crtc *crtc, > struct drm_crtc_state *old_crtc_state) > { > @@ -66,6 +71,7 @@ static const struct drm_crtc_funcs bochs_crtc_funcs = { > static const struct drm_crtc_helper_funcs bochs_helper_funcs = { > .mode_set_nofb = bochs_crtc_mode_set_nofb, > .atomic_enable = bochs_crtc_atomic_enable, > + .atomic_disable = bochs_crtc_atomic_disable, Shouldn't we make the callback optional instead of adding empty dummy functions to drivers? cheers, Gerd