On Tue, 2018-09-25 at 10:22 -0600, Logan Gunthorpe wrote:
> @@ -83,9 +132,14 @@ static int pci_p2pdma_setup(struct pci_dev *pdev)
>  
>       pdev->p2pdma = p2p;
>  
> +     error = sysfs_create_group(&pdev->dev.kobj, &p2pmem_group);
> +     if (error)
> +             goto out_pool_destroy;
> +
>       return 0;
>  
>  out_pool_destroy:
> +     pdev->p2pdma = NULL;
>       gen_pool_destroy(p2p->pool);
>  out:
>       devm_kfree(&pdev->dev, p2p);

This doesn't look right to me. Shouldn't devm_remove_action() be called instead
of devm_kfree() if sysfs_create_group() fails?

Thanks,

Bart.

_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm

Reply via email to