diff options
author | Sean Anderson <seanga2@gmail.com> | 2022-09-28 03:41:57 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-09-29 05:18:42 +0300 |
commit | d4ddeefa64ab36d211ff57a64d263c158e017581 (patch) | |
tree | d9d35e9d9bb65d715a2f7f60c1fdabd4f639f56e /drivers/net/ethernet/sun/sunhme.c | |
parent | f45892f750384433056cdb5601ef13ce9acbad76 (diff) | |
download | linux-d4ddeefa64ab36d211ff57a64d263c158e017581.tar.xz |
net: sunhme: Fix undersized zeroing of quattro->happy_meals
Just use kzalloc instead.
Fixes: d6f1e89bdbb8 ("sunhme: Return an ERR_PTR from quattro_pci_find")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20220928004157.279731-1-seanga2@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/sun/sunhme.c')
-rw-r--r-- | drivers/net/ethernet/sun/sunhme.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c index 3afa73db500c..62deed210a95 100644 --- a/drivers/net/ethernet/sun/sunhme.c +++ b/drivers/net/ethernet/sun/sunhme.c @@ -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; |