Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp1080556imc; Mon, 11 Mar 2019 06:09:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqyOFQMTFsd/S4blr5n15JRkKUTOBlICnD3pMWzcTzZqREilzTjP6kp8+mk6itqlinY/T9Sl X-Received: by 2002:a17:902:70c9:: with SMTP id l9mr8660859plt.131.1552309764591; Mon, 11 Mar 2019 06:09:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552309764; cv=none; d=google.com; s=arc-20160816; b=Li7bMBsDkhVgEK/7DP9LL6tD5W6PK7LKHHUPn/zTefTMUo8MdmMpd+0+gznJpCV0Om kzGZE7jH3gotpPvFnksWnFIce73BQmfjQryOHK4r5E1Rsmv5HoDyPNodc4Ljer2SqQN7 YwdcUgUXZLcK5uHmrOjC1ydqeLaXkfyYK1QxCzWzTA9zjD07k8cheyV7VjfZ9zK2Zu8r OJdItkUoipYVey6rxRwF7N14VAIobHBIYQqBSTGhfMxhPqVtY6J+NVywQVE0w5olUzNF +E2TX8Eck54Y2pEBJ8n1DjsoBAkyPhBBC/iOdlBH16r7SrWeicDE21FSiLYDqPdF3qXI aQWg== 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=T5ykBZJXTyDl/mBNZ3DX81nryo4p3wLHc2zGCX9qqS4=; b=VjSlCWFTXKLkfn+GZi5AYbVSwbzII6E/VlxbSM0n+Sl4TAUwOimH2s4JBhWJA5hbhg ag3/FTk0Jj7ZUAB0hf2f/cNuv+GRlH+iO5ELYp8y3cpvxyccltRmSRF+WKWKHU0pat9r JmigNPo+rFjMZExhmtbIXrLCOvbTEciM38c9mwaljmqTCIYEujSZjJYNxG+Uj7D+FA0+ kQ1plTMdS7zMCCq57fLrYpkhrytVcID0l3YbBHHmzDvhZVlLihw90SQk+kbwB8F+hhZW 30BXUM36uwDrcaBkyySwobmFfSMyZZ7OZhkv4vSVjrVHr9fqOBoM6hxgFPegdtXu+LjC iAYQ== 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 f1si4564082pgv.418.2019.03.11.06.09.08; Mon, 11 Mar 2019 06:09:24 -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 S1727433AbfCKNHS (ORCPT + 99 others); Mon, 11 Mar 2019 09:07:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:63262 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725943AbfCKNHR (ORCPT ); Mon, 11 Mar 2019 09:07:17 -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 937013087BB5; Mon, 11 Mar 2019 13:07:17 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-117-175.ams2.redhat.com [10.36.117.175]) by smtp.corp.redhat.com (Postfix) with ESMTP id 411EC5D706; Mon, 11 Mar 2019 13:07:17 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 6AC5017532; Mon, 11 Mar 2019 14:07:16 +0100 (CET) Date: Mon, 11 Mar 2019 14:07:16 +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: <20190311130716.6hjqci43clic5lxx@sirius.home.kraxel.org> References: <20190310212150.xhhb4abzm7j3ain2@smtp.gmail.com> <20190311062200.4mtel3j5fjxtxrcf@sirius.home.kraxel.org> <20190311101159.t6mbzm5sdwuh5muc@smtp.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190311101159.t6mbzm5sdwuh5muc@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 13:07:17 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, > > > 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? > > Hi Gerd, > > I agree, and I can work in this issue. > Just one question, should we make atomic_enable optional as well? IIRC the drm code checks for the atomic_enable callback presence to figure whenever it should take the atomic or legacy code paths. So, I think that will not work. cheers, Gerd