From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21511C6379D for ; Thu, 19 Nov 2020 13:50:42 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7D2CC22264 for ; Thu, 19 Nov 2020 13:50:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ouxYq8Iy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7D2CC22264 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=tkos.co.il Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:In-reply-to:Subject:To: From:References:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=KsPaNYLL0rNxqORExzMu3KkC1yBxYFR4gb8VP6lrWes=; b=ouxYq8IyJWZeOvP+YRlts6INn F+NncMY8woHvaEIUOnM85uIC6Mtd8DCRJvuLHvBQKnF9S/CrVfBcNykWpLJiKY1cf7CtIz7gi7Rv8 zr1IAuCrQJ+FfsS/kJxF0mka8VaIenjqD8q1D/UHBPcAHw15xmbu3Sw8g1wUKd5nwViSnYcuq7Lv5 49KYc/Qaq+TFdlnmM8XJJDrmKP7SKxhcgygphx+FhDxAssF1Uem2WksxUmR5wjQ0xnHIZKqWdQkjH p6qSGSqHM6dPo7Fmp/ZouVBuscMmAYM84DnCk+ReUO/paAjjBJfbpo743Y7fYDEymu8+6Yn+zL5e/ GAbufsgOg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kfkJz-0004dD-RP; Thu, 19 Nov 2020 13:50:00 +0000 Received: from guitar.tcltek.co.il ([192.115.133.116] helo=mx.tkos.co.il) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kfkHc-0003Va-HO for linux-arm-kernel@lists.infradead.org; Thu, 19 Nov 2020 13:47:34 +0000 Received: from tarshish (unknown [10.0.8.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx.tkos.co.il (Postfix) with ESMTPS id 966C844064A; Thu, 19 Nov 2020 15:47:18 +0200 (IST) References: <20201118231811.GH1853236@lunn.ch> <878sax6f43.fsf@tarshish> <20201119133429.GS1804098@lunn.ch> User-agent: mu4e 1.4.13; emacs 27.1 From: Baruch Siach To: Andrew Lunn Subject: Re: [PATCH 3/5] gpio: mvebu: add pwm support for Armada 8K/7K In-reply-to: <20201119133429.GS1804098@lunn.ch> Date: Thu, 19 Nov 2020 15:47:18 +0200 Message-ID: <877dqhfogp.fsf@tarshish> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201119_084733_094862_9E28A32E X-CRM114-Status: GOOD ( 22.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-pwm@vger.kernel.org, Sascha Hauer , Jason Cooper , linux-gpio@vger.kernel.org, Linus Walleij , Chris Packham , Bartosz Golaszewski , Thierry Reding , Thomas Petazzoni , Uwe =?utf-8?Q?Kleine-K?= =?utf-8?Q?=C3=B6nig?= , Ralph Sennhauser , Lee Jones , Gregory Clement , linux-arm-kernel@lists.infradead.org, Sebastian Hesselbarth Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Andrew, On Thu, Nov 19 2020, Andrew Lunn wrote: >> >> @@ -1200,6 +1235,13 @@ static int mvebu_gpio_probe(struct platform_device *pdev) >> >> >> >> devm_gpiochip_add_data(&pdev->dev, &mvchip->chip, mvchip); >> >> >> >> + /* Some MVEBU SoCs have simple PWM support for GPIO lines */ >> >> + if (IS_ENABLED(CONFIG_PWM)) { >> >> + err = mvebu_pwm_probe(pdev, mvchip, id); >> >> + if (err) >> >> + return err; >> >> + } >> >> + >> > >> > The existing error handling looks odd here. Why is there no goto >> > err_domain when probing the PWMs fails? I wonder if this a bug from me >> > from a long time again? >> >> What would you release under the err_domain label? As far as I can see >> all resources are allocated using devres, and released automatically on >> failure exit. > > The IRQ domain is still registers. So once the memory is automatically > freed, don't we have a potential use after free? This patch moves PWM registration before IRQ domain registration for another reason as mentioned in the commit log. So this might incidentally fix the bug. Would you prefer a separate patch for that with a 'Fixes: 757642f9a584e8' tag? baruch -- ~. .~ Tk Open Systems =}------------------------------------------------ooO--U--Ooo------------{= - baruch@tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il - _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel