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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8B7EEC7EE32 for ; Thu, 1 Jun 2023 10:01:08 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 95908862D0; Thu, 1 Jun 2023 12:00:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (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=1685613643; bh=zKzw4DnyuWVp2O8QJCdLt44MKUCnxaa1c95GLb17D2g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=YjmIByMyyHB81XbfVcZB52iQN6Kvxx+uNZV8eeeMdteJdHCx6l/rmdunLl1yHYl0E AxPH95DoPnWxcbrUTo/MyZfO3MKAXnPx/axD8urgHLk6St3dCe9QvA2TuiL4rgggrd Z9XbabHkv3wtL7i75qd7eoK8GM+JSpgF8h52t2I+CSmY4aaPsmsD84RjISpeE/ldwx GTe4sqGfZtwxdKtQrgVu4M+spOwhQsPgpN++B7fkiQg6I1SlY5X3rMAOE+ml0nn243 ntNoMRhsRPnFPhCisEUwmAwsDIxEnMHnH0AbxE2LSSGyGMLQcu7VK/peVmWVxBV2Ki VByfJEF2nph8g== Received: from localhost.localdomain (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: lukma@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 7FC47862C6; Thu, 1 Jun 2023 12:00:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1685613631; bh=zKzw4DnyuWVp2O8QJCdLt44MKUCnxaa1c95GLb17D2g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Qp8PkCqD2Dv5mR5PXP0VPE4VzZ4xalFL4QA8Tf5Ls9rkG/DGZ9/CpgUJPlIeTYYeX Xa77SrTpiNFegxOJOHyrGmK46H44HUqh+gKC+XrTjknuOkqU7sppTwy67ohmUrwFsl 1kX3srGPneIKrqUJ8Yy16GsHhwxgYCUhKJMONmVWJ81vMaWFxZJ1oy6w1cxwdtTlDU oFBZlokNXIa1+M3TEzfDqjgU0nXjGqgAdE8n0a83jhmNZvBVfbY+J1nB3UUnH8co9L 6maQO2fJ9v7qCwO2FwdqOkDs7jNs5sf5fCtuKwSpFkJNahWLVNdJUylr9SBjGWESrt D5wZTUuJ77B2g== From: Lukasz Majewski To: u-boot@lists.denx.de, Tom Rini Cc: Anatolij Gustschin , Lukasz Majewski , Ramon Fried , Joe Hershberger , Marek Vasut , Michal Simek Subject: [PATCH v1 3/6] net: mv88e61xx: Clear temporary structs before using them in get_phy_id() Date: Thu, 1 Jun 2023 12:00:02 +0200 Message-Id: <20230601100005.2216345-4-lukma@denx.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230601100005.2216345-1-lukma@denx.de> References: <20230601100005.2216345-1-lukma@denx.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.8 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 4aee83551beb..c19c3dfa8b6d 100644 --- a/drivers/net/phy/mv88e61xx.c +++ b/drivers/net/phy/mv88e61xx.c @@ -1213,6 +1213,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 -- 2.30.2