diff options
author | Hans de Goede <hdegoede@redhat.com> | 2023-03-20 13:38:15 +0300 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2023-03-20 17:20:05 +0300 |
commit | 6f561677c2f234bcf215350b76f2a2fea95fbebf (patch) | |
tree | ff6cb48e83876073d006c3e0947e5b77c261a144 /drivers/platform/x86/intel/vsec.c | |
parent | d908084385a41cfdb82dca6ab4086e3f1a9dd4ae (diff) | |
download | linux-6f561677c2f234bcf215350b76f2a2fea95fbebf.tar.xz |
platform/x86/intel: vsec: Use intel_vsec_dev_release() to simplify init() 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
Diffstat (limited to 'drivers/platform/x86/intel/vsec.c')
-rw-r--r-- | drivers/platform/x86/intel/vsec.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/platform/x86/intel/vsec.c b/drivers/platform/x86/intel/vsec.c index 01b1f6480e5c..42904b431d87 100644 --- a/drivers/platform/x86/intel/vsec.c +++ b/drivers/platform/x86/intel/vsec.c @@ -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; } |