From patchwork Wed Sep 28 00:41:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12991527 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 591FAC54EE9 for ; Wed, 28 Sep 2022 00:42:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 859068E010A; Tue, 27 Sep 2022 20:42:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 808A28E00C1; Tue, 27 Sep 2022 20:42:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6D06B8E010A; Tue, 27 Sep 2022 20:42:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 5D65E8E00C1 for ; Tue, 27 Sep 2022 20:42:02 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id F0A99409C3 for ; Wed, 28 Sep 2022 00:42:01 +0000 (UTC) X-FDA: 79959642042.19.28DD89B Received: from mail-qt1-f179.google.com (mail-qt1-f179.google.com [209.85.160.179]) by imf07.hostedemail.com (Postfix) with ESMTP id 9C2994000C for ; Wed, 28 Sep 2022 00:42:00 +0000 (UTC) Received: by mail-qt1-f179.google.com with SMTP id cj27so7105394qtb.7 for ; Tue, 27 Sep 2022 17:42:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=24mwch+9Dgf0bZ4LPZLYwZNGujwjKCMpUS4L9Z2MX10=; b=DKYJHdTkLK//5MQoKkDunUh2q+VHJXJ3NjAo7NDenLx7wsSl29hb64U1rp9sCJZhEm vuIZnk9QVaBR/3FqIrVuWgfsQItVDU5xp6+cESkGhqttDfRq2P8Tw1PreIC+XaqUY7Q7 Ribmva8kDQXfjrA1XlIaazmIrlxkTRtXogIj3GB11RU+YiVTDYX1ZeYhAKms+uNxMKIy aC9sN3aCMoJvZlZp2UcUTOM+GcHTi7MItVjgf3wCoqbTnOwupw0mcoG2eoBspWfagcoG q2JN7EsFqlCd8FRaFCRIwYsJJqfuNeOt0fRKmr7N6994KBtJlniYCOw93DFN/WZumlwQ 89pA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=24mwch+9Dgf0bZ4LPZLYwZNGujwjKCMpUS4L9Z2MX10=; b=CCl/Z6/QQ+Hr4pmTynZYPdxtrWErE04ke06bzEHnqxh9kwDizhHgEfLCzi9mz4z2Lr bjM8ITwA9YtbUoHdSs87hwMk3AdCNyN6gbGyoJjL4hWdI6O/xr8JsizEdF1oh3Pw5RzU VAoQm5FCA9AqeT5Gz8McroJUsgKPSyR3cuiUb/CtGIPyVJSHu5VzLvUa5mr4hKJPgItp cZqCA+c2W+R7G68TxK0ojXYLI9m/wqMqyqWD+CBUSFiH2qQFI1E6I5AW6+xTypIT7d5x dGJBsGuDLVnBtBh6zNpRMiIyHGh6uU51Ssg/+dzFHGw4PJ2FE4DKk3y12DHGr43KEMVV /k9g== X-Gm-Message-State: ACrzQf0qrgVIQKPS3g0DNI2HGAn+JQF2dZHgjZcgEv1kxgZCsuTlU0KS K4A5OpA7IhpD5kHy+B/oonQ= X-Google-Smtp-Source: AMsMyM71QPWcluMXvjmXZ5+03EMl+SSoGU52lJ2NzuWoiORPgIEhxniDJ+YwMz893gkdch+VdpKSmg== X-Received: by 2002:a05:622a:1492:b0:35c:b7e6:12ef with SMTP id t18-20020a05622a149200b0035cb7e612efmr25029590qtx.94.1664325719845; Tue, 27 Sep 2022 17:41:59 -0700 (PDT) Received: from localhost (pool-173-73-95-180.washdc.fios.verizon.net. [173.73.95.180]) by smtp.gmail.com with UTF8SMTPSA id bj7-20020a05620a190700b006bad7a2964fsm1937831qkb.78.2022.09.27.17.41.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 27 Sep 2022 17:41:59 -0700 (PDT) From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Rolf Eike Beer , Zheyu Ma , Nick Bowler , Linux Memory Management List , linux-kernel@vger.kernel.org, Sean Anderson , kernel test robot Subject: [PATCH net-next] net: sunhme: Fix undersized zeroing of quattro->happy_meals Date: Tue, 27 Sep 2022 20:41:57 -0400 Message-Id: <20220928004157.279731-1-seanga2@gmail.com> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1664325720; a=rsa-sha256; cv=none; b=kbwzdOiOyYx+4Y1MSzEPniccu9PvbiI1HTtqKt/QxreODxrezRip6gJskdDQiR+srd55f2 GQRL9ZKcZEd583RBp0L3yZzl15Aa4aKp+sgVxjsJ6I4S3jFEmX2VBFPqOeGzKzcctgQGN6 WGlJr/zQeZL58Z5yRVloy3G8VF9e/zM= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=DKYJHdTk; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf07.hostedemail.com: domain of seanga2@gmail.com designates 209.85.160.179 as permitted sender) smtp.mailfrom=seanga2@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1664325720; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=24mwch+9Dgf0bZ4LPZLYwZNGujwjKCMpUS4L9Z2MX10=; b=FKV3j6JYCRsWaju7hpZqI1Vv5WHIswGCN/+yYN1yXJcAK5qc3fb9nN5SAGBnj/XjefAdmV sWRPf45Sl7wIzRUk8hNixI2aAEqZtM/JhNnEt02C4pZrZAtwxZ7JNjR9YH6BtIUG6OxZkn goX5JJei0VYzHDqqVZvK/OVQhgtlIMU= X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 9C2994000C X-Rspam-User: Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=DKYJHdTk; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf07.hostedemail.com: domain of seanga2@gmail.com designates 209.85.160.179 as permitted sender) smtp.mailfrom=seanga2@gmail.com X-Stat-Signature: dd4uthtfetkphwdi486p69331b31mhw8 X-HE-Tag: 1664325720-679412 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Just use kzalloc instead. Fixes: d6f1e89bdbb8 ("sunhme: Return an ERR_PTR from quattro_pci_find") Reported-by: kernel test robot Signed-off-by: Sean Anderson --- drivers/net/ethernet/sun/sunhme.c | 4 +--- 1 file changed, 1 insertion(+), 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;