Skip to contentSkip to conversation

net: sunhme: Fix undersized zeroing of quattro->happy_meals

PATCH Applied Sean Anderson 2 participants 2 messages Sep 28, 2022 – Sep 29, 2022

Subsystems (4)
lore
Share & tools
lore

Sean Anderson

author maintainer
#0 lore raw

PATCH 1/1 net: sunhme: Fix undersized zeroing of quattro->happy_meals

Just use kzalloc instead.

Fixes d6f1e89bdbb8 ("sunhme: Return an ERR_PTR from quattro_pci_find")

---

 drivers/net/ethernet/sun/sunhme.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/ethernet/sun/sunhme.c +1 -3
index 3afa73db500c..62deed210a95 100644
@@ -2409,12 +2409,10 @@ static struct quattro *quattro_sbus_find(struct platform_device *child)
 	if (qp)
 		return qp;
 
-	qp = kmalloc(sizeof(struct quattro), GFP_KERNEL);
+	qp = kzalloc(sizeof(*qp), GFP_KERNEL);
 	if (!qp)
 		return NULL;
 
-	memset(qp->happy_meals, 0, sizeof(*qp->happy_meals));
-
 	qp->quattro_dev = child;
 	qp->next = qfe_sbus_list;
 	qfe_sbus_list = qp;
Signature · 1 line
2.37.1
#1 lore raw
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Tue, 27 Sep 2022 20:41:57 -0400 you wrote:

Just use kzalloc instead.

Fixes d6f1e89bdbb8 ("sunhme: Return an ERR_PTR from quattro_pci_find")

---

[...]

Here is the summary with links:
- [net-next] net: sunhme: Fix undersized zeroing of quattro->happy_meals
https://git.kernel.org/netdev/net-next/c/d4ddeefa64ab

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html