[PATCH -next 3/3] firmware: stratix10-svc: add missing platform_device_unregister()
From: Yang Yingliang
Date: Tue Jul 19 2022 - 10:18:55 EST
Add missing platform_device_unregister() in error path in
stratix10_svc_drv_probe().
Fixes: e6281c26674e ("firmware: stratix10-svc: Add support for FCS")
Signed-off-by: Yang Yingliang <yangyingliang@xxxxxxxxxx>
---
drivers/firmware/stratix10-svc.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/firmware/stratix10-svc.c b/drivers/firmware/stratix10-svc.c
index cb824f63faa8..bde1f543f529 100644
--- a/drivers/firmware/stratix10-svc.c
+++ b/drivers/firmware/stratix10-svc.c
@@ -1209,13 +1209,13 @@ static int stratix10_svc_drv_probe(struct platform_device *pdev)
if (!svc->intel_svc_fcs) {
dev_err(dev, "failed to allocate %s device\n", INTEL_FCS);
ret = -ENOMEM;
- goto err_free_kfifo;
+ goto err_unregister_dev;
}
ret = platform_device_add(svc->intel_svc_fcs);
if (ret) {
platform_device_put(svc->intel_svc_fcs);
- goto err_free_kfifo;
+ goto err_unregister_dev;
}
dev_set_drvdata(dev, svc);
@@ -1224,6 +1224,8 @@ static int stratix10_svc_drv_probe(struct platform_device *pdev)
return 0;
+err_unregister_dev:
+ platform_device_unregister(svc->stratix10_svc_rsu);
err_free_kfifo:
kfifo_free(&controller->svc_fifo);
err_destroy_pool:
--
2.25.1