From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 D539D345CC9 for ; Thu, 5 Mar 2026 11:11:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772709119; cv=none; b=a1EbJxGAqHYCxg3BIF5jGtFDqXdiSgAjaY+0ApzXjjC/AIL93njMBDIqR0ArqY8OTSRGwU8g/CEM8iPzX5AUrkmVorVZRxGb6NNsTg8DcpY7FQCSzWBPFu2sca2z44CS6taOi8Ps7pv3hAIwE6cpZKWST80ItgbuVEWeeYTuDIA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772709119; c=relaxed/simple; bh=B873sRwQ1J5CCn/I3TZ27cfOdjvggNk5/UwePR4qofQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Wo3k+XnPH7OvU3mpbDR9IQZ9HAtgRz3mWG6j+KFHKIQgb5WpwNwOKya4eSKTlOyj3D05ujLY/LeP1UiSo7bHqbSOHd6VhVFUyPlqQ8dMXDv/59SzhxLNCBa1eMMEWZ0qfjvZbbK3U0uvuEYc4BHD6Spz/813j1Iw3hRGtfRI+2s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=T0CdbOUo; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=nKKVFOHL; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="T0CdbOUo"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="nKKVFOHL" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1772709117; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fkxCRFYiRt8J6Zp/a/+uZknb9+WKEd8QL5JOgoUkxw4=; b=T0CdbOUoFM1lH6aR06iEyDtyuUZgf7ahVYiWflWkVO6rn07V3anY78htdtSiBndEfyK0+h oHhGaxOpzSikMliphH5l+9xTdEcgrOc/KcLyLgScnNUaruQrtxtcxOKI3MULpmaE2lGoAp 8j9Dwa2gStpCsrCOFS37DzBgNg/kMOc= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-630-eG-lMwAUOFS7x0KYCwbZqg-1; Thu, 05 Mar 2026 06:11:55 -0500 X-MC-Unique: eG-lMwAUOFS7x0KYCwbZqg-1 X-Mimecast-MFC-AGG-ID: eG-lMwAUOFS7x0KYCwbZqg_1772709115 Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-506ab115571so568607081cf.0 for ; Thu, 05 Mar 2026 03:11:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1772709115; x=1773313915; darn=vger.kernel.org; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=fkxCRFYiRt8J6Zp/a/+uZknb9+WKEd8QL5JOgoUkxw4=; b=nKKVFOHLKtqB9NmjzoBHkQmNB6+UyJqGFV/alSHWfAq04JHic4Xqq6Yj1cJs/mzKRf PcczZri8M7LVDHqyz2kfvBDUvJHTQUGO87GRh3cUP4xUVR0bEgLDUI6uxRFZdVpgeYdW aLBhuqKXL1Np7+LpM+YO2611Ou+X5nOL64E3kLiKHYtU+6iP6jDxKj+iiiuERl/ZrOB0 E0i9jTc8ng+6PM7MN/IzkXTDAFw96i2XAggrDvsO3dQPa0Zhk1Criv8z1MnCASvb/o7x Yw9XAdjARx80g1kCeouZh2rMMtiSIsvTy/E5x36MaXCrPqWVkR9CeyQujox5UMREeaZK uMbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772709115; x=1773313915; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=fkxCRFYiRt8J6Zp/a/+uZknb9+WKEd8QL5JOgoUkxw4=; b=R5OIs/s6nBzdIJbX+z4sEJf1i/xelgtc341wX8gkdqvVN6hQ9sS2gK53lH+Guo/Grx 0x3gKeTWt7rNkRrBN0O9l/UCNBfYACo/imL4BYljTW4Eqh52+68sNFxm97TE19A7vZ24 0W/RlingLBe9mPAc8ZdLFxhfDZzqWCpb/MmtEaErsAgzQ6CGbCaj80a75rooAeUTpnuF OWHOFDhFtAuGZcjUMkR5obXyoOyNsotPuPALt/0bs4etZNtJ9wt+JscQc+mDygsLKjPx R4zynthCrBijeqW9yuk7YZ68mFW8rNoY+BqqNySBPQPYipYrV5atzdFKFFr2KFELUhbx jUKA== X-Forwarded-Encrypted: i=1; AJvYcCUoegDXRerpht8ffHtVkcR16be6mWgBOai5scQjCbKJ2zVlhsdPdL+hpApJAGTxS6styx03hXOtD/da7AU=@vger.kernel.org X-Gm-Message-State: AOJu0Yxv9CsyaQ74rCe9HQTTWI9rM0+SIrErrB/toW8bka7Bd6KEKGm5 iyFYInWUpwuVEmZ1IxkTXgib7llcKyZAIy+emnrCikAuiqNghR6Fx2UlV4FPIMPlGAzpa+VpUHx t1Zp2TPeOJMaW8WfMHYEW3K2Tbg6A52vvsV4fggcxnn6pLLYYPMocbjmeQAoIIXHkvA== X-Gm-Gg: ATEYQzwIiMe0l9IfncheUZE7ir3sHb5751fX93U6TChol3qsvjVUyoTYIC9a/udhgcK 709PVAMs5BIMoWO5tV2xGbX5K1iS4hziyYcpJbTyHNqWv9R2ORUCNTwSYZKYeVcQsj8IV5/pg3Q XeIlq8POYtrWRmaEcELL0JjU0QthSRoyAPs7go+Z4lOqiTTLfzw7Kcxv2ABbt9HXdUk+g0IGIps sx7RUUtMqToNzxgF65TiygnqoGwpltjC9v0RkhYhjRfFXbL/Bs+0EfM/lciDW+hRTcdFk2BvRbo JBEduhswiDP96Rh812wX1w2T45PgVULbQ2Lb+sG6AWaYsDUAypK5SxpV26+cV0+zF71zidsLMTn X8bAVd5OBOCM8nOFpfMaPboEeIPLyLhVsUWqGd5lqvMG8Wll7mhVtRnlu X-Received: by 2002:ac8:5f0d:0:b0:506:542d:2b3a with SMTP id d75a77b69052e-508db25d6c0mr65191091cf.11.1772709115281; Thu, 05 Mar 2026 03:11:55 -0800 (PST) X-Received: by 2002:ac8:5f0d:0:b0:506:542d:2b3a with SMTP id d75a77b69052e-508db25d6c0mr65190921cf.11.1772709114890; Thu, 05 Mar 2026 03:11:54 -0800 (PST) Received: from redhat.com (c-73-183-52-120.hsd1.pa.comcast.net. [73.183.52.120]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-899f4fb7c53sm120590996d6.30.2026.03.05.03.11.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Mar 2026 03:11:54 -0800 (PST) Date: Thu, 5 Mar 2026 06:11:53 -0500 From: Brian Masney To: =?iso-8859-1?Q?J=2E_Neusch=E4fer?= Cc: Michael Turquette , Stephen Boyd , Tao Lan , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] clk: hisilicon: Improve deallocation in error path Message-ID: References: <20260303-hisi-error-v2-1-7cd9b43d8fbb@posteo.net> 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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/2.2.14 (2025-02-20) On Thu, Mar 05, 2026 at 09:02:11AM +0000, J. Neuschäfer wrote: > On Wed, Mar 04, 2026 at 10:00:15AM -0500, Brian Masney wrote: > > On Tue, Mar 03, 2026 at 04:25:18PM +0100, J. Neuschäfer via B4 Relay wrote: > > > From: "J. Neuschäfer" > > > > > > Unmap 'base' if an error occurs after it has been mapped. > > > > > > Reported-by: Tao Lan > > > Closes: https://lore.kernel.org/lkml/ZNlSH+eWV8Sk3FYn@probook/ > > > Signed-off-by: J. Neuschäfer > > > > My understanding is that you need to use your full first name in the > > Signed-off-by. > > I have been contributing to the Linux kernel and other projects using my > abbreviated first name for over a year. It has been mostly well received. Sorry I should have checked. > > > Changes in v2: > > > - Rebase on v7.0-rc2 > > > - Update my email address > > > - Reword the commit message somewhat > > > - Link to v1: https://lore.kernel.org/r/20240708-hisi-error-v1-1-727bc7399b63@gmx.net > > > --- > > > drivers/clk/hisilicon/clk.c | 4 +++- > > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > > > diff --git a/drivers/clk/hisilicon/clk.c b/drivers/clk/hisilicon/clk.c > > > index fae65127cd4aa8..08050ff1c8cf9a 100644 > > > --- a/drivers/clk/hisilicon/clk.c > > > +++ b/drivers/clk/hisilicon/clk.c > > > @@ -70,7 +70,7 @@ struct hisi_clock_data *hisi_clk_init(struct device_node *np, > > > > > > clk_data = kzalloc_obj(*clk_data); > > > if (!clk_data) > > > - goto err; > > > + goto err_base; > > > > > > clk_data->base = base; > > > clk_table = kzalloc_objs(*clk_table, nr_clks); > > > @@ -83,6 +83,8 @@ struct hisi_clock_data *hisi_clk_init(struct device_node *np, > > > return clk_data; > > > err_data: > > > kfree(clk_data); > > > +err_base: > > > + iounmap(base); > > > > Use devm_of_iomap() and it will be automatically cleaned up for you. > > This would require a larger restructuring of the HiSilicon clock drivers > to pass a struct device * to hisi_clk_init. I'd rather avoid that > because I can't currently test these drivers and because the benefit is > questionable. However, I still had the upstreaming of this patch in my > backlog, and I think it's simple enough to review as is. OK, fair enough. Reviewed-by: Brian Masney