greybus: connection: remove extra kfree() call

When an error occurs in the device_add() call for a connection, the
device reference is dropped as required.  Because that's the device's
only reference, that will also lead to gb_connection_release() being
called, which frees the connection structure.

Right now we're then making an extra request to free the connection,
which is wrong.  Fix that.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Alex Elder 2015-06-12 10:21:06 -05:00 committed by Greg Kroah-Hartman
parent 55a8e35503
commit 856618f3fb

View file

@ -219,7 +219,7 @@ struct gb_connection *gb_connection_create(struct gb_bundle *bundle,
gb_connection_hd_cport_id_free(connection);
gb_protocol_put(connection->protocol);
put_device(&connection->dev);
kfree(connection);
return NULL;
}