summaryrefslogtreecommitdiff
path: root/drivers/firmware/raspberrypi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/firmware/raspberrypi.c')
-rw-r--r--drivers/firmware/raspberrypi.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/firmware/raspberrypi.c b/drivers/firmware/raspberrypi.c
index ec07bf26e5eb..c3bc29e0a488 100644
--- a/drivers/firmware/raspberrypi.c
+++ b/drivers/firmware/raspberrypi.c
@@ -288,9 +288,11 @@ static int rpi_firmware_probe(struct platform_device *pdev)
fw->cl.tx_block = true;
fw->chan = mbox_request_channel(&fw->cl, 0);
- if (IS_ERR(fw->chan))
- return dev_err_probe(dev, PTR_ERR(fw->chan),
- "Failed to get mbox channel\n");
+ if (IS_ERR(fw->chan)) {
+ int ret = PTR_ERR(fw->chan);
+ kfree(fw);
+ return dev_err_probe(dev, ret, "Failed to get mbox channel\n");
+ }
init_completion(&fw->c);
kref_init(&fw->consumers);