]> git.karo-electronics.de Git - linux-beck.git/commitdiff
greybus: fw-core: destroy connections on error
authorViresh Kumar <viresh.kumar@linaro.org>
Thu, 19 May 2016 12:57:25 +0000 (18:27 +0530)
committerGreg Kroah-Hartman <gregkh@google.com>
Fri, 20 May 2016 23:36:43 +0000 (16:36 -0700)
In one of the error cases we aren't destroying the connections created
earlier. Fix it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/fw-core.c

index 90d32227a490b8992131ee38785f2ef37b613674..33941efe13ea21b7965ace859a58648f50a1be95 100644 (file)
@@ -139,7 +139,7 @@ static int gb_fw_core_probe(struct gb_bundle *bundle,
                        dev_err(&bundle->dev, "invalid protocol id (0x%02x)\n",
                                protocol_id);
                        ret = -EINVAL;
-                       goto err_free_fw_core;
+                       goto err_destroy_connections;
                }
        }
 
@@ -187,7 +187,6 @@ err_destroy_connections:
        gb_connection_destroy(fw_core->mgmt_connection);
        gb_connection_destroy(fw_core->spi_connection);
        gb_connection_destroy(fw_core->download_connection);
-err_free_fw_core:
        kfree(fw_core);
 
        return ret;