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, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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 CEDC0C2D0E4 for ; Thu, 19 Nov 2020 13:34:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7DD6322264 for ; Thu, 19 Nov 2020 13:34:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726853AbgKSNes (ORCPT ); Thu, 19 Nov 2020 08:34:48 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:38160 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726480AbgKSNer (ORCPT ); Thu, 19 Nov 2020 08:34:47 -0500 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1kfk4z-007w8v-Lm; Thu, 19 Nov 2020 14:34:29 +0100 Date: Thu, 19 Nov 2020 14:34:29 +0100 From: Andrew Lunn To: Baruch Siach Cc: Thierry Reding , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Lee Jones , Linus Walleij , Bartosz Golaszewski , Jason Cooper , Gregory Clement , Sebastian Hesselbarth , Thomas Petazzoni , Chris Packham , Sascha Hauer , Ralph Sennhauser , linux-pwm@vger.kernel.org, linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 3/5] gpio: mvebu: add pwm support for Armada 8K/7K Message-ID: <20201119133429.GS1804098@lunn.ch> References: <20201118231811.GH1853236@lunn.ch> <878sax6f43.fsf@tarshish> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <878sax6f43.fsf@tarshish> Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org > >> @@ -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? Andrew