Skip to content

Commit

Permalink
platform/x86/intel: vsec: Use intel_vsec_dev_release() to simplify in…
Browse files Browse the repository at this point in the history
…it() error cleanup

On auxiliary_device_init(auxdev) failure we need to do the exact same
cleanup steps as on device.release(), so use the intel_vsec_dev_release()
callback for this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230320103815.229729-1-hdegoede@redhat.com
  • Loading branch information
Hans de Goede committed Mar 20, 2023
1 parent d908084 commit 6f56167
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions drivers/platform/x86/intel/vsec.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,7 @@ int intel_vsec_add_aux(struct pci_dev *pdev, struct device *parent,

ret = auxiliary_device_init(auxdev);
if (ret < 0) {
mutex_lock(&vsec_ida_lock);
ida_free(intel_vsec_dev->ida, auxdev->id);
mutex_unlock(&vsec_ida_lock);
kfree(intel_vsec_dev->resource);
kfree(intel_vsec_dev);
intel_vsec_dev_release(&auxdev->dev);
return ret;
}

Expand Down

0 comments on commit 6f56167

Please sign in to comment.