diff mbox series

[02/14] firmware: scmi: mailbox transport: fix probe failure implementation

Message ID 20211104142324.2879-2-etienne.carriere@linaro.org
State Superseded
Headers show
Series [01/14] firmware: scmi: fix description of an API function | expand

Commit Message

Etienne Carriere Nov. 4, 2021, 2:23 p.m. UTC
Correct scmi mailbox probe function that can't free the scmi channel
instance since its auto-allocated by the device model framework.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
---
 drivers/firmware/scmi/mailbox_agent.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

-- 
2.17.1
diff mbox series

Patch

diff --git a/drivers/firmware/scmi/mailbox_agent.c b/drivers/firmware/scmi/mailbox_agent.c
index ea35e7e09e..eb841d692b 100644
--- a/drivers/firmware/scmi/mailbox_agent.c
+++ b/drivers/firmware/scmi/mailbox_agent.c
@@ -72,17 +72,13 @@  int scmi_mbox_probe(struct udevice *dev)
 	ret = mbox_get_by_index(dev, 0, &chan->mbox);
 	if (ret) {
 		dev_err(dev, "Failed to find mailbox: %d\n", ret);
-		goto out;
+		return ret;
 	}
 
 	ret = scmi_dt_get_smt_buffer(dev, &chan->smt);
 	if (ret)
 		dev_err(dev, "Failed to get shm resources: %d\n", ret);
 
-out:
-	if (ret)
-		devm_kfree(dev, chan);
-
 	return ret;
 }