Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1367604lqa; Mon, 29 Apr 2024 06:48:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVPoxy0eR/MgD8zE28rrCxj24tPYQNquh7CMOdeeODe2MzvNlLt4rccij1I0qwUHhtNArWe3tlvudhXaVB6xXCASQw44NFuzLmPKtFvbQ== X-Google-Smtp-Source: AGHT+IH8eHz+q9nHyGZcF6nu4uYa1L+MTUs7Whr4LEhbNpK+1Kn5jiDcE3nqlr8Zsf5teeqPxpu+ X-Received: by 2002:a17:906:b78c:b0:a58:ff19:1bd7 with SMTP id dt12-20020a170906b78c00b00a58ff191bd7mr2503986ejb.24.1714398483470; Mon, 29 Apr 2024 06:48:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714398483; cv=pass; d=google.com; s=arc-20160816; b=Eg5WS/MuAlYBukVptI2KmqYYBStxS3tlkOPX4yiswei+TnmJcwrIwkfYp0IzFCTp4S TqcH2pNp+ZjLRwlcoJCrJP2g2Ek/ks1pPSk8pihRo5m6VEhKPSHRsoOKdunoKttwei9p bFEl+mBPtez988A1Ig4p8sBFkt4kXW9yBM1ak6LB4NsHG2gkXktxqYYn5ym3BdE+3HgY XXXXjk0y0/zBs6Y7lPqIRSYFpS++vTeAZxxbMLq9X47wIC0KBwIowGDygAY1k3ki1vI8 6vixObn0oNw6Qp2gwN43/ziLVDdgaKawcBrThr7FoWvJVF/xqIIaRlCO08Az1qNOg05z cL+A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=qQTwjYz3X0GB6Y/k4B6SzTnCmAB5PLMeWmRMWzpsRUk=; fh=03CJe6NhrJfv1V2W8jX4aiBPLNQV44wiAU8uuqD3D4Q=; b=Agua6kZ+Mqp0cFOISKz6/SKhwrklunnJxHE/o7r0Ayw6y8sWEPI/dEazrkVNxH4ulN /vbYeKjs+wf9IEq6DCJCPLHzPC8HOG+lfLkJ0zDyPb3nmXMRGfylVESSSm4pM1UYoDn5 CP0o+d2nc+Ww2MgeuM0Tn+qUf2JTaKJIoO3UB5/f352hqTc5QVHsF3BZ76dHbUFPuRfI QYW27kYUcZs/wjiSw/yjNap/W7ca5m6QBn7SpE1UxV/C0fh2Y3AACav9gzBmh1l+6zfv JUe1PiBFGZwG+QH6hifmtgzuToDK8WfRoJKt9J/59LRsTPfF1WSnTx6v9s/HVrsCRt1f b4bw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XZfa7dJK; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-162380-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162380-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id y25-20020a1709060a9900b00a58e556e6b3si2984677ejf.633.2024.04.29.06.48.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 06:48:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-162380-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XZfa7dJK; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-162380-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162380-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 573781F243DF for ; Mon, 29 Apr 2024 13:39:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 93E1474422; Mon, 29 Apr 2024 13:39:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="XZfa7dJK" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ADF876A00B; Mon, 29 Apr 2024 13:39:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714397965; cv=none; b=pOSU/JBScw8B4xcRf1ukAgsH0beMQhfnhSNXG2/QxQyVUUivzXHsSIDqI+znxDdyM2pDAYLoVN4Zzz0pI0OvV50tresruQtzwC7ec63a9DnZSqaqkmj5BKq5rpByMXU9dSY1oyN2GbfhJd1SDTOREALxj0h8CSkfkIrO+uJk/oY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714397965; c=relaxed/simple; bh=Xd+ih7r9s5+9LMe8W6DLUFmMehgeoqexmv4quZsszi0=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=bALba64MMlDMh6kngkcCPOVbyPAyqoKFZ3HY9E2sAebpA5RoTKVHifEjv6JNK2hVaHBqZXqZNqSHB5U3D6iPw75WDXyAgXmV4CFiYMsC9C5FFWsW94oOAQM9sj9oQG+MPD3EQJXtvldIGX5lWQpwe0dqS/aclCc3oawpd33At1Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XZfa7dJK; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB757C113CD; Mon, 29 Apr 2024 13:39:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714397965; bh=Xd+ih7r9s5+9LMe8W6DLUFmMehgeoqexmv4quZsszi0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=XZfa7dJKWOKJ0OjsCShBm9W3KR8eIwmAPk3oQ0FoHLsoim3McvEROI79qoluZfVS4 9grNin8eT9RUMP/pmtCEMijbap0BaJMmJ6zQtND2dedNA5nqFsb2JC5lj+CqnVKFbq fpo6tOBsity4C1OB4khsAZSYNwqwTPZuRZwJOTWfcASZDlgAe2qJMN/aajc5RgLeH9 vwK3mhzeg0edR+IRAa0rylEFIRG2Ilh+fe+wgIQmK5XbmrRdS+AmOeGBupy+decQDW hXKiyPpS5to38jOpFqIhXeRwng64QrEEW3EnCwOfSDobZUeN5qwCe6omeH+b2jkD4L XoZTcw888pgNQ== Date: Mon, 29 Apr 2024 06:39:23 -0700 From: Jakub Kicinski To: Luiz Angelo Daros de Luca Cc: Linus Walleij , Alvin =?UTF-8?B?xaBpcHJhZ2E=?= , Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH net-next v2 3/3] net: dsa: realtek: add LED drivers for rtl8366rb Message-ID: <20240429063923.648c927f@kernel.org> In-Reply-To: <20240427-realtek-led-v2-3-5abaddc32cf6@gmail.com> References: <20240427-realtek-led-v2-0-5abaddc32cf6@gmail.com> <20240427-realtek-led-v2-3-5abaddc32cf6@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sat, 27 Apr 2024 02:11:30 -0300 Luiz Angelo Daros de Luca wrote: > +static int rtl8366rb_setup_leds(struct realtek_priv *priv) > +{ > + struct device_node *leds_np, *led_np; > + struct dsa_switch *ds = &priv->ds; > + struct dsa_port *dp; > + int ret = 0; > + > + dsa_switch_for_each_port(dp, ds) { > + if (!dp->dn) > + continue; > + > + leds_np = of_get_child_by_name(dp->dn, "leds"); > + if (!leds_np) { > + dev_dbg(priv->dev, "No leds defined for port %d", > + dp->index); > + continue; > + } > + > + for_each_child_of_node(leds_np, led_np) { > + ret = rtl8366rb_setup_led(priv, dp, > + of_fwnode_handle(led_np)); > + if (ret) { > + of_node_put(led_np); > + break; > + } > + } > + > + of_node_put(leds_np); > + if (ret) > + return ret; > + } > + return 0; > +} coccicheck generates this warning: drivers/net/dsa/realtek/rtl8366rb.c:1032:4-15: ERROR: probable double put. I think it's a false positive. But aren't you missing a put(dp) before "return ret;" ?