[PATCH] drm/i915: add check for valid init_clock_gating-pointer

Wolfram Sang w.sang at pengutronix.de
Sun Jun 19 12:22:11 PDT 2011


On Thu, Jun 16, 2011 at 04:47:53PM +0100, Chris Wilson wrote:
> On Thu, 16 Jun 2011 08:15:57 -0700, Jesse Barnes <jbarnes at virtuousgeek.org> wrote:
> > On Thu, 16 Jun 2011 15:28:46 +0200
> > Wolfram Sang <w.sang at pengutronix.de> wrote:
> > > How about BUG_ON(!ptr) in the init-routine for a bit more grace? And/or
> > > a warning in the else-block? It seems to happen to users...
> > 
> > Yeah, a BUG_ON would be fine.
> 
> if (WARN_ON(!ptr, "no display vtable"))
> 	return -ENODEV;

That would mean converting the involved void-functions to int to propagate the
error (intel_init_clock_gating, intel_modeset_init). Not a big deal, but quite
intrusive. Do you really mean that?

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20110619/3f264a3e/attachment.pgp>


More information about the dri-devel mailing list