From patchwork Wed Mar 17 14:14:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 1454695 X-Patchwork-Delegate: rfried.dev@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=gqhV4JW9; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4F0scT5Srpz9sVm for ; Thu, 18 Mar 2021 01:15:05 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0572F82886; Wed, 17 Mar 2021 15:14:37 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1615990477; bh=rMZ1Ys2Lis8tlFythFfVRg9TzeWGEMzfcrlZfm5+cX4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=gqhV4JW9qsqgin0oDwfy8tgejgbcEd+4tRV6Z2Bv24+iQvpHjqF8DSFcA0Qwt8Ha7 dsu6FD8FZNDRdD2Gfzi5MdKZC5qAoWOP1x/2hD4Hl2UITqfyvD1KCBfzAVWG/nXNdQ MMdlO5OGyg8Uay/+WVbqNh5nt0GXEWHJczCyDMIrlBCin+imcyOL2KqC0hnBP1z+4s SALHaKyhNhlekKGslP6OJL63jZIkgxhZcFnN//vC/LwPemAyr3xc1Om/rq9xyCIzlE 7VbPabgLk6QeJWUYX8AQ/aDTQHj93h7o/rbdpkkrpE/62/DE9dYhVAkGyKqYUurP9p 8kOWyICtGjTsg== Received: by phobos.denx.de (Postfix, from userid 109) id C5DDD82886; Wed, 17 Mar 2021 15:14:28 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 328518285A for ; Wed, 17 Mar 2021 15:14:26 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=lukma@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4F0sbj4lKLz1qsjf; Wed, 17 Mar 2021 15:14:25 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4F0sbj4PHTz1r1MR; Wed, 17 Mar 2021 15:14:25 +0100 (CET) Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id 5H55JCGBHJRJ; Wed, 17 Mar 2021 15:14:24 +0100 (CET) X-Auth-Info: YBr+k5r+cw6dlaprJdmHHfra2tHugHixnsQegY2RBOE= Received: from localhost.localdomain (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Wed, 17 Mar 2021 15:14:24 +0100 (CET) From: Lukasz Majewski To: u-boot@lists.denx.de Cc: Lukasz Majewski , Joe Hershberger , Ramon Fried , Simon Glass Subject: [PATCH v1 3/6] net: mv88e61xx: Clear temporary structs before using them in get_phy_id() Date: Wed, 17 Mar 2021 15:14:07 +0100 Message-Id: <20210317141410.32152-4-lukma@denx.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210317141410.32152-1-lukma@denx.de> References: <20210317141410.32152-1-lukma@denx.de> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean Those automatically created structures can have random value. However, mv88e61xx driver assumes that those are zeroed. Signed-off-by: Lukasz Majewski Reviewed-by: Ramon Fried --- drivers/net/phy/mv88e61xx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/phy/mv88e61xx.c b/drivers/net/phy/mv88e61xx.c index 14074c0b82fb..d8116530700d 100644 --- a/drivers/net/phy/mv88e61xx.c +++ b/drivers/net/phy/mv88e61xx.c @@ -1230,6 +1230,10 @@ int get_phy_id(struct mii_dev *bus, int smi_addr, int devad, u32 *phy_id) struct mii_dev temp_mii; int val; + memset(&temp_phy, 0, sizeof(temp_phy)); + memset(&temp_priv, 0, sizeof(temp_priv)); + memset(&temp_mii, 0, sizeof(temp_mii)); + /* * Buid temporary data structures that the chip reading code needs to * read the ID