Commit e7d75863 authored by Marek Lindner's avatar Marek Lindner Committed by Greg Kroah-Hartman

batman-adv: fix hardif_neigh refcount on queue_work() failure

[ Upstream commit 4c4af6900844ab04c9434c972021d7b48610e06a ]

The hardif_neigh refcounter is to be decreased by the queued work and
currently is never decreased if the queue_work() call fails.
Fix by checking the queue_work() return value and decrease refcount
if necessary.
Signed-off-by: default avatarMarek Lindner <>
Signed-off-by: default avatarSven Eckelmann <>
Signed-off-by: default avatarSimon Wunderlich <>
Signed-off-by: default avatarSasha Levin <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent 0b296f3d
......@@ -243,6 +243,7 @@ static void batadv_v_elp_periodic_work(struct work_struct *work)
struct batadv_priv *bat_priv;
struct sk_buff *skb;
u32 elp_interval;
bool ret;
bat_v = container_of(work, struct batadv_hard_iface_bat_v,;
hard_iface = container_of(bat_v, struct batadv_hard_iface, bat_v);
......@@ -304,8 +305,11 @@ static void batadv_v_elp_periodic_work(struct work_struct *work)
* may sleep and that is not allowed in an rcu protected
* context. Therefore schedule a task for that.
ret = queue_work(batadv_event_workqueue,
if (!ret)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment