OSDN Git Service

greybus: connection: drop unneeded gb_protocol_put() calls
authorAlex Elder <elder@linaro.org>
Fri, 12 Jun 2015 15:21:07 +0000 (10:21 -0500)
committerGreg Kroah-Hartman <gregkh@google.com>
Fri, 12 Jun 2015 19:13:01 +0000 (12:13 -0700)
commitdeb58ca8299598f81123dd92456c0cc3a9a38555
treee8937f363364ec50c52625bde9afe21c1cebe800
parent856618f3fb6506f277adf060717590d03d3fb559
greybus: connection: drop unneeded gb_protocol_put() calls

Although a connection records its protocol id when it gets
created, its protocol handler doesn't actually get assigned
until gb_connection_bind_protocol() is called.

In gb_connection_create() there are some error paths in
which a reference to the connection's protocol is released
before the protocol handler has been associated with the
connection.

Get rid of those calls.

As a result, we will never pass a null protocol pointer to
gb_protocol_put().  Add a precautionary warning in that
function in the event that ever occurs.

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