From: Rodrigo Siqueira Subject: Re: [PATCH] drm/bochs: Fix NULL dereference on atomic_disable helper Date: Mon, 11 Mar 2019 07:11:59 -0300 Message-ID: <20190311101159.t6mbzm5sdwuh5muc@smtp.gmail.com> References: <20190310212150.xhhb4abzm7j3ain2@smtp.gmail.com> <20190311062200.4mtel3j5fjxtxrcf@sirius.home.kraxel.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="drhezydywvhjq3od" Return-path: Content-Disposition: inline In-Reply-To: <20190311062200.4mtel3j5fjxtxrcf@sirius.home.kraxel.org> Sender: linux-kernel-owner@vger.kernel.org To: Gerd Hoffmann Cc: David Airlie , Daniel Vetter , virtualization@lists.linux-foundation.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org List-Id: dri-devel@lists.freedesktop.org --drhezydywvhjq3od Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 03/11, Gerd Hoffmann wrote: > 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: > >=20 > > BUG: unable to handle kernel NULL pointer dereference at 00000000000000= 00 >=20 > > ? drm_atomic_helper_commit_modeset_disables+0x396/0x3e0 [drm_kms_helpe= r] >=20 > > +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 = =3D { > > static const struct drm_crtc_helper_funcs bochs_helper_funcs =3D { > > .mode_set_nofb =3D bochs_crtc_mode_set_nofb, > > .atomic_enable =3D bochs_crtc_atomic_enable, > > + .atomic_disable =3D bochs_crtc_atomic_disable, >=20 > 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? =20 Thanks for your feedback, Best Regards > cheers, > Gerd >=20 --=20 Rodrigo Siqueira https://siqueira.tech Graduate Student Department of Computer Science University of S=E3o Paulo --drhezydywvhjq3od Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE4tZ+ii1mjMCMQbfkWJzP/comvP8FAlyGNG8ACgkQWJzP/com vP8wsw//UrL8vOCTOcYISOmd6tDS5RI41osGF/+I4UGtvgY9czxtp/cpff7wdgXb fOKvat7nsgRrX1HtfKbf/nVflpI9ifyrtzCGrip8jor7Tyd5luhXSVfeqjvbYYbm V1hoz8zU0nXKgM+ysgtRrBvLTDWpzgWw8ruvEJmHKoVX2W2PSptRsYGyhbbkXn7w YhKjEstNbL9Bhswd7HTN91udpqUFgOMCld4Zz2XPoO3bvWEM5TGYQMWFcprsDyLQ LpuSfftjkoJnXuzz+fOOI4+tBKJaBUOa/OJcSzwWV79jKGMucKI8jrSdY6x/sZGv LG8+/z5knRAUrrCAByjalucp2CFohe4Xgl0FEtcvNVnK7ShiTFwtuN/M2HqdnjaC Gw2NCiAuA7ZvXRDLgiCpjnejcG5kF9oPTGVkOtV0FoEn4j/u7OohvWGtq7RvPU+Y +BJkwe0itpXiFk8BpoPfWfg5cFi8oEY2PiLYDqjYSxjGv0WxTAnwgFqiwNVqwwlN cQgJUxvUUU015kyyHHZj8bY6xms11Wp0NF2MR8V1EuMF8w2XBfEM4DsTpvoTojRz d47QaG7jQBR5sfMu0vMjAbUMctxK4tpbxQj1I3Tg8B+QrNU3IVT8ufDbw4POMltK g2f/m6xDHBk9o0mIR528WBjf48zAfOQSHmEJtptQ2U7YB4E5GX4= =4Sg3 -----END PGP SIGNATURE----- --drhezydywvhjq3od--