Commit 825f79ae authored by Viresh Kumar's avatar Viresh Kumar Committed by Greg Kroah-Hartman

greybus: fw-core: destroy connections on error

In one of the error cases we aren't destroying the connections created
earlier. Fix it.
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 4aea5a15
...@@ -139,7 +139,7 @@ static int gb_fw_core_probe(struct gb_bundle *bundle, ...@@ -139,7 +139,7 @@ static int gb_fw_core_probe(struct gb_bundle *bundle,
dev_err(&bundle->dev, "invalid protocol id (0x%02x)\n", dev_err(&bundle->dev, "invalid protocol id (0x%02x)\n",
protocol_id); protocol_id);
ret = -EINVAL; ret = -EINVAL;
goto err_free_fw_core; goto err_destroy_connections;
} }
} }
...@@ -187,7 +187,6 @@ static int gb_fw_core_probe(struct gb_bundle *bundle, ...@@ -187,7 +187,6 @@ static int gb_fw_core_probe(struct gb_bundle *bundle,
gb_connection_destroy(fw_core->mgmt_connection); gb_connection_destroy(fw_core->mgmt_connection);
gb_connection_destroy(fw_core->spi_connection); gb_connection_destroy(fw_core->spi_connection);
gb_connection_destroy(fw_core->download_connection); gb_connection_destroy(fw_core->download_connection);
err_free_fw_core:
kfree(fw_core); kfree(fw_core);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment