From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 2EAB430E82D for ; Thu, 11 Jun 2026 08:13:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781165589; cv=none; b=I8XbGMm66EMRX54d/hTHYUfB2XCrnv+972bFvKRHGStykDPPStafiApOx1fwRcYei04AUoCZrfMX5izdbm8/1z27cJQu/1pwqJXEGIcXXcIedy7ig1T5i+8CXtt5FhZVdpvrPxYGvZl9sqXziwLu5SkiFWvo32R82uz9j2tOjEw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781165589; c=relaxed/simple; bh=LsyFCid0Mv+KxVbzJTNsmbCi5wbpmKaHRPuGrP8/UFE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=T+oJd2Z5evo8LcDFYz1SMFYcpzs3ZIdNvwgguZZHZitPQf1rEXVf4Y0inqWmV6F6eEnKnCnfXzH39qlhoFJtuiKxx4JpZMjZsmguK0r6KZCy66wMn8FzPhUcM5G/dVkIMOvUEpUhbLe8WSoPHj+b2k6Ro7ny8IStcXptXnUvBDU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1wXaX8-0007T2-Ri; Thu, 11 Jun 2026 10:13:02 +0200 Received: from pty.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::c5]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wXaX8-002BKN-2b; Thu, 11 Jun 2026 10:13:02 +0200 Received: from pza by pty.whiteo.stw.pengutronix.de with local (Exim 4.98.2) (envelope-from ) id 1wXaX8-0000000EMAH-2vwO; Thu, 11 Jun 2026 10:13:02 +0200 Date: Thu, 11 Jun 2026 10:13:02 +0200 From: Philipp Zabel To: WenTao Liang Cc: Hans de Goede , linux-kernel@vger.kernel.org Subject: Re: [PATCH] reset: fix refcount leak in reset_control_bulk_assert() Message-ID: References: <20260611015731.57989-1-vulab@iscas.ac.cn> 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-Disposition: inline In-Reply-To: <20260611015731.57989-1-vulab@iscas.ac.cn> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: pza@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org On Thu, Jun 11, 2026 at 09:57:31AM +0800, WenTao Liang wrote: > When reset_control_bulk_assert() asserts a batch of reset controls, > it calls reset Can you write a better commit message? What does this patch accomplish, and why? > Fixes: 0b52297f2288 ("reset: Add support for shared reset controls") > Signed-off-by: WenTao Liang > --- > drivers/reset/core.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/drivers/reset/core.c b/drivers/reset/core.c > index 38e189d04d09..daf9201bc105 100644 > --- a/drivers/reset/core.c > +++ b/drivers/reset/core.c > @@ -516,8 +516,15 @@ int reset_control_assert(struct reset_control *rstc) > if (WARN_ON(atomic_read(&rstc->deassert_count) == 0)) > return -EINVAL; > > - if (atomic_dec_return(&rstc->deassert_count) != 0) > + if (atomic_dec_return(&rstc->deassert_count) != 0) { > + int err = rcdev->ops->assert(rcdev, rstc->id); This is wrong, asserting the reset must not happen unless deassert_count has been decremented to zero. regards Philipp