[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220719140257.3499657-3-yangyingliang@huawei.com>
Date: Tue, 19 Jul 2022 22:02:57 +0800
From: Yang Yingliang <yangyingliang@...wei.com>
To: <linux-kernel@...r.kernel.org>
CC: <dinguyen@...nel.org>
Subject: [PATCH -next 3/3] firmware: stratix10-svc: add missing platform_device_unregister()
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@...wei.com>
---
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
Powered by blists - more mailing lists