From: Szymon Janc Date: Wed, 16 Nov 2011 08:32:22 +0000 (+0100) Subject: Bluetooth: Simplify __l2cap_global_chan_by_addr X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=250938cb370351fb603e1d47292377421bb029b2;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git Bluetooth: Simplify __l2cap_global_chan_by_addr Make __l2cap_global_chan_by_addr similar to other find functions. Signed-off-by: Szymon Janc Signed-off-by: Gustavo F. Padovan --- diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 26925a8f8ead..7c746ec85143 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c @@ -154,12 +154,9 @@ static struct l2cap_chan *__l2cap_global_chan_by_addr(__le16 psm, bdaddr_t *src) list_for_each_entry(c, &chan_list, global_l) { if (c->sport == psm && !bacmp(&bt_sk(c->sk)->src, src)) - goto found; + return c; } - - c = NULL; -found: - return c; + return NULL; } int l2cap_add_psm(struct l2cap_chan *chan, bdaddr_t *src, __le16 psm)