[Intel-gfx] [PATCH 09/51] drm/cirrus: Use drmm_add_final_kfree

Gerd Hoffmann kraxel at redhat.com
Tue Mar 3 07:49:34 UTC 2020


> @@ -575,9 +574,12 @@ static int cirrus_pci_probe(struct pci_dev *pdev,
>  
>  	dev = &cirrus->dev;
>  	ret = drm_dev_init(dev, &cirrus_driver, &pdev->dev);
> -	if (ret)
> -		goto err_free_cirrus;
> +	if (ret) {
> +		kfree(cirrus);
> +		goto err_pci_release;
> +	}
>  	dev->dev_private = cirrus;
> +	drmm_add_final_kfree(dev, cirrus);

That doesn't look like an error path improvement.
With patch #30 applied it'll looks alot better though.
So maybe squash the patches?

In any case:
Acked-by: Gerd Hoffmann <kraxel at redhat.com>

cheers,
  Gerd



More information about the Intel-gfx mailing list