|
|
@@ -1772,6 +1772,7 @@ batadv_bla_loopdetect_check(struct batadv_priv *bat_priv, struct sk_buff *skb,
|
|
|
{
|
|
|
struct batadv_bla_backbone_gw *backbone_gw;
|
|
|
struct ethhdr *ethhdr;
|
|
|
+ bool ret;
|
|
|
|
|
|
ethhdr = eth_hdr(skb);
|
|
|
|
|
|
@@ -1795,8 +1796,13 @@ batadv_bla_loopdetect_check(struct batadv_priv *bat_priv, struct sk_buff *skb,
|
|
|
if (unlikely(!backbone_gw))
|
|
|
return true;
|
|
|
|
|
|
- queue_work(batadv_event_workqueue, &backbone_gw->report_work);
|
|
|
- /* backbone_gw is unreferenced in the report work function function */
|
|
|
+ ret = queue_work(batadv_event_workqueue, &backbone_gw->report_work);
|
|
|
+
|
|
|
+ /* backbone_gw is unreferenced in the report work function function
|
|
|
+ * if queue_work() call was successful
|
|
|
+ */
|
|
|
+ if (!ret)
|
|
|
+ batadv_backbone_gw_put(backbone_gw);
|
|
|
|
|
|
return true;
|
|
|
}
|