[Intel-gfx] [PATCH 02/46] drm/i915: Split device release from unload

Joonas Lahtinen joonas.lahtinen at linux.intel.com
Wed Feb 8 13:41:19 UTC 2017


On to, 2017-02-02 at 09:08 +0000, Chris Wilson wrote:
> We may need to keep our memory management alive after we have unloaded
> the physical pci device. For example, if we have exported an object via
> dmabuf, that will keep the device around but the pci device may be
> removed before the dmabuf itself is released, use of the pci hardware
> will be revoked, but the memory and object management needs to persist
> for the dmabuf.
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

<SNIP>

> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -1299,7 +1299,8 @@ int i915_driver_load(struct pci_dev *pdev, const struct pci_device_id *ent)
>  	pci_disable_device(pdev);
>  out_free_priv:
>  	i915_load_error(dev_priv, "Device initialization failed (%d)\n", ret);
> -	drm_dev_unref(&dev_priv->drm);
> +	drm_dev_fini(&dev_priv->drm);
> +	kfree(dev_priv);
>  	return ret;
>  }

This function could use goto err; as there's kfree up there too.

With that teardown path;

Reviewed-by: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation


More information about the Intel-gfx mailing list