]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
greybus: drop the cport id on error
authorAlex Elder <elder@linaro.org>
Wed, 29 Oct 2014 00:35:58 +0000 (19:35 -0500)
committerGreg Kroah-Hartman <greg@kroah.com>
Wed, 29 Oct 2014 00:42:17 +0000 (08:42 +0800)
In gb_connection_create(), if an error occurs adding a connection's
device, the cport id assigned to the AP end of the connection is not
getting freed.  Fix that.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/staging/greybus/connection.c

index 69ea3a7887715341ca2c5d9fc2cc1f919c7b6959..3fee64773976809c70794cb416b796d96a6e468a 100644 (file)
@@ -186,6 +186,8 @@ struct gb_connection *gb_connection_create(struct gb_interface *interface,
 
        retval = device_add(&connection->dev);
        if (retval) {
+               gb_connection_hd_cport_id_free(connection);
+               /* kref_put(connection->hd); */
                kfree(connection);
                return NULL;
        }