From: Julia Lawall Date: Mon, 16 May 2011 09:20:29 +0000 (+0200) Subject: drivers/staging/ath6kl/os/linux/cfg80211.c: Add missing call to cfg80211_put_bss X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d93089df1b752e4da048cd7f4749d29120b65e55;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git drivers/staging/ath6kl/os/linux/cfg80211.c: Add missing call to cfg80211_put_bss A call to cfg80211_get_bss hould be accompanied by a call to cfg80211_put_bss in error-handling code. A simplified version of the semantic match that finds this problem is: (http://coccinelle.lip6.fr/) // @r exists@ local idexpression struct cfg80211_bss * x; expression ra,rr; position p1,p2; @@ x = cfg80211_get_bss@p1(...) ... when != x = rr when != cfg80211_put_bss(x,...) when != if (...) { ... cfg80211_put_bss(x,...) ...} if(...) { ... when != x = ra when forall when != cfg80211_put_bss(x,...) \(return <+...x...+>; \| return@p2...; \) } @script:python@ p1 << r.p1; p2 << r.p2; @@ cocci.print_main("cfg80211_get_bss",p1) cocci.print_secs("return",p2) // Signed-off-by: Julia Lawall Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/ath6kl/os/linux/cfg80211.c b/drivers/staging/ath6kl/os/linux/cfg80211.c index efd4ae5c5cf9..1e6a3431a609 100644 --- a/drivers/staging/ath6kl/os/linux/cfg80211.c +++ b/drivers/staging/ath6kl/os/linux/cfg80211.c @@ -545,6 +545,7 @@ ar6k_cfg80211_connect_event(struct ar6_softc *ar, u16 channel, if(!ieeemgmtbuf) { AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: ieeeMgmtbuf alloc error\n", __func__)); + cfg80211_put_bss(bss); return; }