Skip to content

Commit 855e431

Browse files
committed
Merge tag 'batadv-net-pullrequest-20251024' of https://git.open-mesh.org/linux-merge
Simon Wunderlich says: ==================== Here is a batman-adv bugfix: - release references to inactive interfaces, by Sven Eckelmann * tag 'batadv-net-pullrequest-20251024' of https://git.open-mesh.org/linux-merge: batman-adv: Release references to inactive interfaces ==================== Link: https://patch.msgid.link/20251024091150.231141-1-sw@simonwunderlich.de Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 parents 46a499a + f12b69d commit 855e431

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

net/batman-adv/originator.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -763,11 +763,16 @@ int batadv_hardif_neigh_dump(struct sk_buff *msg, struct netlink_callback *cb)
763763
bat_priv = netdev_priv(mesh_iface);
764764

765765
primary_if = batadv_primary_if_get_selected(bat_priv);
766-
if (!primary_if || primary_if->if_status != BATADV_IF_ACTIVE) {
766+
if (!primary_if) {
767767
ret = -ENOENT;
768768
goto out_put_mesh_iface;
769769
}
770770

771+
if (primary_if->if_status != BATADV_IF_ACTIVE) {
772+
ret = -ENOENT;
773+
goto out_put_primary_if;
774+
}
775+
771776
hard_iface = batadv_netlink_get_hardif(bat_priv, cb);
772777
if (IS_ERR(hard_iface) && PTR_ERR(hard_iface) != -ENONET) {
773778
ret = PTR_ERR(hard_iface);
@@ -1327,11 +1332,16 @@ int batadv_orig_dump(struct sk_buff *msg, struct netlink_callback *cb)
13271332
bat_priv = netdev_priv(mesh_iface);
13281333

13291334
primary_if = batadv_primary_if_get_selected(bat_priv);
1330-
if (!primary_if || primary_if->if_status != BATADV_IF_ACTIVE) {
1335+
if (!primary_if) {
13311336
ret = -ENOENT;
13321337
goto out_put_mesh_iface;
13331338
}
13341339

1340+
if (primary_if->if_status != BATADV_IF_ACTIVE) {
1341+
ret = -ENOENT;
1342+
goto out_put_primary_if;
1343+
}
1344+
13351345
hard_iface = batadv_netlink_get_hardif(bat_priv, cb);
13361346
if (IS_ERR(hard_iface) && PTR_ERR(hard_iface) != -ENONET) {
13371347
ret = PTR_ERR(hard_iface);

0 commit comments

Comments
 (0)