Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3541180imm; Mon, 4 Jun 2018 05:27:03 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIHWhny228UpZKWmXD0PcUzCHEv2z71aoGZffia8qgsa2SdwpZBKhvxY2OEChriW0AEPt83 X-Received: by 2002:a65:66c6:: with SMTP id c6-v6mr17109601pgw.76.1528115223524; Mon, 04 Jun 2018 05:27:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528115223; cv=none; d=google.com; s=arc-20160816; b=gxUF/ji/q3YcsD9oOM/Ovqu4qur9V+z28jmL3JVZqQWtebrmYlbgiuWSc/60ffPlnl xK83ne5of34J0EsLLUfAl+aoCayBuvFwTFvna6i1BpprfIhJ7Tr3qzo2ZEp/3QXXI9S6 oGcn41n0VKL4FFZ6y29GRwccDFbuGEKzFxvftjM59eANqrF6tMBbkUU+nF9CWi9kEzMM 1ggbAXXQdkmYPN+1P4WIo1ugiB15ki4DpHsBEOoHtCaaUjoyid2gshw7LL9COFNluuMI mNipqHbshQa+dVzGCO5qcpSQXH4gUt9xkTZ6ieGkfldoaNJ0QpOSxaSqvB/C1gAIvtF3 uRBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=D4lCDdAAhD9/7v72Q5b1lrdCoZxLmzqqkvSTK3/AIo8=; b=m/WtJbWbGpYD0ltBsBvaRk0Lz2V6kWB5b+4fXIpryPLCbGaNQVFbmhcT40u6q+aggf hHnzol4V7x0KMjGAXv6Oi2VeULLDooAeO/VHaRGERJY7yf/h7HJoxrBuE4qgvE7TG5ne PgRbqxipYBGAv9Q1D6IUUt/17vuhYPEkJl1rONvC+wAyG3uOqlHHj7XW/64qlMlCiWFX CqcEQD6hzpydQ7wYrfT1lmuQ/QsKQLHWH7iRXWJDjjEVZf2KkZWaiGNVeGS1d0PQWeBt WPAgmiwcLEuh1ZcBsQREDC/iXLUtbZem6MGn39Nb8S7VySMosc5E2fq+fvz6rzLtYFD7 Wf+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BD3gRw3g; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e5-v6si36986671pgn.339.2018.06.04.05.26.48; Mon, 04 Jun 2018 05:27:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BD3gRw3g; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752990AbeFDMYQ (ORCPT + 99 others); Mon, 4 Jun 2018 08:24:16 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:35485 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752633AbeFDMYO (ORCPT ); Mon, 4 Jun 2018 08:24:14 -0400 Received: by mail-wr0-f193.google.com with SMTP id l10-v6so8205863wrn.2 for ; Mon, 04 Jun 2018 05:24:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=D4lCDdAAhD9/7v72Q5b1lrdCoZxLmzqqkvSTK3/AIo8=; b=BD3gRw3gVfmVtOSCDeJpdqMnJJoeB16xHyoUoQb+uEBxPgaiZhrq92hM3Mz4qrpFkB UvAMRc6jbOd67oxwggW7cyiX8o4D4A5uE3mDJnho/MNTTKZfhWPEEotfajRP0SGGQ+L7 ry+RUO3vi66aUPhUM5yv/JcupVL/7Cc1TfOMs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=D4lCDdAAhD9/7v72Q5b1lrdCoZxLmzqqkvSTK3/AIo8=; b=MiV/NJMrf5xyYDhX+M9DsqTJ+JBD/WBMhjP72Ju5dcnh9CsAOSfl03ekLeLYj3Xfq8 KMdn8Ch7WArLMHyDnwkWlmDPZPC7zRhsAB5d+IEmxdOHaqWR2nQhWGFs/kRH227JFbW5 WVLf/xVNlkMTLxGZ5qw4czjdpkhLy7pJ8y/yvfj9/F4aEhh/pBbmIc9JLGAfosDnQlIK PrmK351Luyq2V30cDGtQPTYuKHSTMLMVujOGH874fpXEi/8cZZUqpFUXi8dSS3WrErQw Y+11sobM/r7oKLJp2BTuBk6s1lThG53dLLDHy8dlUlCtVhE/UyBn8BLwNU7L+9fXEFbh jXnw== X-Gm-Message-State: ALKqPwc3BV0qH7Vh3uXq5QXIJ3S/skfrdP6HSyBK6vu6jhVah+SqdLyw u7+kQ/h30ynxv5t3FP/C6zy9A4Tdaok= X-Received: by 2002:adf:a54a:: with SMTP id j10-v6mr17624830wrb.155.1528115053253; Mon, 04 Jun 2018 05:24:13 -0700 (PDT) Received: from dell ([2.31.167.234]) by smtp.gmail.com with ESMTPSA id r9-v6sm6726639wrs.63.2018.06.04.05.24.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Jun 2018 05:24:12 -0700 (PDT) Date: Mon, 4 Jun 2018 13:24:10 +0100 From: Lee Jones To: Marek Vasut Cc: linux-kernel@vger.kernel.org, Marek Vasut , Geert Uytterhoeven , Mark Brown , Steve Twiss , Wolfram Sang , linux-renesas-soc@vger.kernel.org Subject: Re: [PATCH v3 01/10] mfd: da9063: Fix failpath in core Message-ID: <20180604122410.GA21163@dell> References: <20180602101155.26375-1-marek.vasut+renesas@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180602101155.26375-1-marek.vasut+renesas@gmail.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 02 Jun 2018, Marek Vasut wrote: > In case mfd_add_devices() fails, da9063_irq_exit() is not called to > undo the IRQchip setup done by da9063_irq_init(). Fix this by adding > the missing fail path. > > Signed-off-by: Marek Vasut > Cc: Geert Uytterhoeven > Cc: Lee Jones > Cc: Mark Brown > Cc: Steve Twiss > Cc: Wolfram Sang > Cc: linux-renesas-soc@vger.kernel.org > --- > V3: New patch > --- > drivers/mfd/da9063-core.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/drivers/mfd/da9063-core.c b/drivers/mfd/da9063-core.c > index 6c2870d4e754..8226ebd8b96d 100644 > --- a/drivers/mfd/da9063-core.c > +++ b/drivers/mfd/da9063-core.c > @@ -229,10 +229,16 @@ int da9063_device_init(struct da9063 *da9063, unsigned int irq) > ret = mfd_add_devices(da9063->dev, -1, da9063_devs, > ARRAY_SIZE(da9063_devs), NULL, da9063->irq_base, > NULL); > - if (ret) > + if (ret) { > dev_err(da9063->dev, "Cannot add MFD cells\n"); > + goto err_irq_exit; > + } > > return ret; > + > +err_irq_exit: > + da9063_irq_exit(da9063); > + return ret; > } > > void da9063_device_exit(struct da9063 *da9063) I haven't seen the later patches yet, so maybe the goto label expanded on, but if it's not, then this would be better: - if (ret) + if (ret) { dev_err(da9063->dev, "Cannot add MFD cells\n"); + da9063_irq_exit(da9063); + } return ret; } -- Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog