* [PATCH AUTOSEL 5.4 02/15] batman-adv: Return directly after a failed batadv_dat_select_candidates() in batadv_dat_forward_data()
[not found] <20240329123445.3086536-1-sashal@kernel.org>
@ 2024-03-29 12:34 ` Sasha Levin
2024-03-29 12:34 ` [PATCH AUTOSEL 5.4 03/15] batman-adv: Improve exception handling in batadv_throw_uevent() Sasha Levin
2024-03-29 12:34 ` [PATCH AUTOSEL 5.4 08/15] ionic: set adminq irq affinity Sasha Levin
2 siblings, 0 replies; 3+ messages in thread
From: Sasha Levin @ 2024-03-29 12:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Markus Elfring, Sven Eckelmann, Simon Wunderlich, Sasha Levin,
mareklindner, a, davem, edumazet, kuba, pabeni, b.a.t.m.a.n,
netdev
From: Markus Elfring <elfring@users.sourceforge.net>
[ Upstream commit ffc15626c861f811f9778914be004fcf43810a91 ]
The kfree() function was called in one case by
the batadv_dat_forward_data() function during error handling
even if the passed variable contained a null pointer.
This issue was detected by using the Coccinelle software.
* Thus return directly after a batadv_dat_select_candidates() call failed
at the beginning.
* Delete the label “out” which became unnecessary with this refactoring.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Acked-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/batman-adv/distributed-arp-table.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c
index dda62dcd59c8a..c5b7e9994a018 100644
--- a/net/batman-adv/distributed-arp-table.c
+++ b/net/batman-adv/distributed-arp-table.c
@@ -682,7 +682,7 @@ static bool batadv_dat_forward_data(struct batadv_priv *bat_priv,
cand = batadv_dat_select_candidates(bat_priv, ip, vid);
if (!cand)
- goto out;
+ return ret;
batadv_dbg(BATADV_DBG_DAT, bat_priv, "DHT_SEND for %pI4\n", &ip);
@@ -726,7 +726,6 @@ static bool batadv_dat_forward_data(struct batadv_priv *bat_priv,
batadv_orig_node_put(cand[i].orig_node);
}
-out:
kfree(cand);
return ret;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH AUTOSEL 5.4 03/15] batman-adv: Improve exception handling in batadv_throw_uevent()
[not found] <20240329123445.3086536-1-sashal@kernel.org>
2024-03-29 12:34 ` [PATCH AUTOSEL 5.4 02/15] batman-adv: Return directly after a failed batadv_dat_select_candidates() in batadv_dat_forward_data() Sasha Levin
@ 2024-03-29 12:34 ` Sasha Levin
2024-03-29 12:34 ` [PATCH AUTOSEL 5.4 08/15] ionic: set adminq irq affinity Sasha Levin
2 siblings, 0 replies; 3+ messages in thread
From: Sasha Levin @ 2024-03-29 12:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Markus Elfring, Sven Eckelmann, Simon Wunderlich, Sasha Levin,
mareklindner, a, davem, edumazet, kuba, pabeni, b.a.t.m.a.n,
netdev
From: Markus Elfring <elfring@users.sourceforge.net>
[ Upstream commit 5593e9abf1cf2bf096366d8c7fd933bc69d561ce ]
The kfree() function was called in up to three cases by
the batadv_throw_uevent() function during error handling
even if the passed variable contained a null pointer.
This issue was detected by using the Coccinelle software.
* Thus adjust jump targets.
* Reorder kfree() calls at the end.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Acked-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/batman-adv/main.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c
index 6a183c94cdeb4..62425d19bd598 100644
--- a/net/batman-adv/main.c
+++ b/net/batman-adv/main.c
@@ -733,29 +733,31 @@ int batadv_throw_uevent(struct batadv_priv *bat_priv, enum batadv_uev_type type,
"%s%s", BATADV_UEV_TYPE_VAR,
batadv_uev_type_str[type]);
if (!uevent_env[0])
- goto out;
+ goto report_error;
uevent_env[1] = kasprintf(GFP_ATOMIC,
"%s%s", BATADV_UEV_ACTION_VAR,
batadv_uev_action_str[action]);
if (!uevent_env[1])
- goto out;
+ goto free_first_env;
/* If the event is DEL, ignore the data field */
if (action != BATADV_UEV_DEL) {
uevent_env[2] = kasprintf(GFP_ATOMIC,
"%s%s", BATADV_UEV_DATA_VAR, data);
if (!uevent_env[2])
- goto out;
+ goto free_second_env;
}
ret = kobject_uevent_env(bat_kobj, KOBJ_CHANGE, uevent_env);
-out:
- kfree(uevent_env[0]);
- kfree(uevent_env[1]);
kfree(uevent_env[2]);
+free_second_env:
+ kfree(uevent_env[1]);
+free_first_env:
+ kfree(uevent_env[0]);
if (ret)
+report_error:
batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
"Impossible to send uevent for (%s,%s,%s) event (err: %d)\n",
batadv_uev_type_str[type],
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH AUTOSEL 5.4 08/15] ionic: set adminq irq affinity
[not found] <20240329123445.3086536-1-sashal@kernel.org>
2024-03-29 12:34 ` [PATCH AUTOSEL 5.4 02/15] batman-adv: Return directly after a failed batadv_dat_select_candidates() in batadv_dat_forward_data() Sasha Levin
2024-03-29 12:34 ` [PATCH AUTOSEL 5.4 03/15] batman-adv: Improve exception handling in batadv_throw_uevent() Sasha Levin
@ 2024-03-29 12:34 ` Sasha Levin
2 siblings, 0 replies; 3+ messages in thread
From: Sasha Levin @ 2024-03-29 12:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Shannon Nelson, Brett Creeley, Jacob Keller, David S . Miller,
Sasha Levin, drivers, edumazet, kuba, pabeni, nitya.sunkad,
netdev
From: Shannon Nelson <shannon.nelson@amd.com>
[ Upstream commit c699f35d658f3c21b69ed24e64b2ea26381e941d ]
We claim to have the AdminQ on our irq0 and thus cpu id 0,
but we need to be sure we set the affinity hint to try to
keep it there.
Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
Reviewed-by: Brett Creeley <brett.creeley@amd.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/pensando/ionic/ionic_lif.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
index d718c1a6d5fc7..e7d868da6a380 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
@@ -1874,9 +1874,12 @@ static int ionic_lif_adminq_init(struct ionic_lif *lif)
napi_enable(&qcq->napi);
- if (qcq->flags & IONIC_QCQ_F_INTR)
+ if (qcq->flags & IONIC_QCQ_F_INTR) {
+ irq_set_affinity_hint(qcq->intr.vector,
+ &qcq->intr.affinity_mask);
ionic_intr_mask(idev->intr_ctrl, qcq->intr.index,
IONIC_INTR_MASK_CLEAR);
+ }
qcq->flags |= IONIC_QCQ_F_INITED;
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-03-29 12:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20240329123445.3086536-1-sashal@kernel.org>
2024-03-29 12:34 ` [PATCH AUTOSEL 5.4 02/15] batman-adv: Return directly after a failed batadv_dat_select_candidates() in batadv_dat_forward_data() Sasha Levin
2024-03-29 12:34 ` [PATCH AUTOSEL 5.4 03/15] batman-adv: Improve exception handling in batadv_throw_uevent() Sasha Levin
2024-03-29 12:34 ` [PATCH AUTOSEL 5.4 08/15] ionic: set adminq irq affinity Sasha Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).