Commit d4ddeefa authored by Sean Anderson's avatar Sean Anderson Committed by Jakub Kicinski

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

Just use kzalloc instead.

Fixes: d6f1e89b ("sunhme: Return an ERR_PTR from quattro_pci_find")
Reported-by: default avatarkernel test robot <lkp@intel.com>
Signed-off-by: default avatarSean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20220928004157.279731-1-seanga2@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent f45892f7
......@@ -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;
......
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