On Tue, Jun 21, 2016 at 03:27:02PM +0200, Daniel Vetter wrote:
> On Tue, Jun 21, 2016 at 09:53:46AM +0100, Chris Wilson wrote:
> > -int i915_driver_load(struct drm_device *dev, unsigned long flags)
> > +int i915_driver_load(struct pci_dev *pdev,
> > +                const struct pci_device_id *ent,
> > +                struct drm_driver *driver)
> >  {
> >     struct drm_i915_private *dev_priv;
> > -   int ret = 0;
> > +   int ret;
> >  
> > +   ret = 0;
> >     dev_priv = kzalloc(sizeof(*dev_priv), GFP_KERNEL);
> > -   if (dev_priv == NULL)
> > +   if (dev_priv)
> > +           ret = drm_dev_init(&dev_priv->drm, driver, &pdev->dev);
> > +   if (ret) {
> 
> This ended up a bit too clever, will fail to spot the failure when
> dev_priv == NULL. I guess you wanted a ret = -ENOMEM up there.

Yup, and we should then return ret rather than return -ENOMEM.
Ta,
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to