mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Moritz Fischer <mdf@kernel.org>
To: Alexey Khoroshilov <khoroshilov@ispras.ru>
Cc: Alan Tull <atull@kernel.org>, Moritz Fischer <mdf@kernel.org>,
	linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org,
	ldv-project@linuxtesting.org
Subject: Re: [PATCH] fpga: socfpga-a10: disable clk on error in socfpga_a10_fpga_probe()
Date: Fri, 1 Dec 2017 17:21:08 -0800	[thread overview]
Message-ID: <20171202012108.x5js74t73f3wkpem@derp-derp.lan> (raw)
In-Reply-To: <1512159984-23948-1-git-send-email-khoroshilov@ispras.ru>

Hi Alexey,

On Fri, Dec 01, 2017 at 11:26:24PM +0300, Alexey Khoroshilov wrote:
> If fpga_mgr_register() fails, a clock is left undisabled.
> 
> Found by Linux Driver Verification project (linuxtesting.org).
> 
> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Reviewed-by: Moritz Fischer <mdf@kernel.org>
> ---
>  drivers/fpga/socfpga-a10.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/fpga/socfpga-a10.c b/drivers/fpga/socfpga-a10.c
> index f8770af0f6b5..a46e343a5b72 100644
> --- a/drivers/fpga/socfpga-a10.c
> +++ b/drivers/fpga/socfpga-a10.c
> @@ -519,8 +519,14 @@ static int socfpga_a10_fpga_probe(struct platform_device *pdev)
>  		return -EBUSY;
>  	}
>  
> -	return fpga_mgr_register(dev, "SoCFPGA Arria10 FPGA Manager",
> +	ret = fpga_mgr_register(dev, "SoCFPGA Arria10 FPGA Manager",
>  				 &socfpga_a10_fpga_mgr_ops, priv);
> +	if (ret) {
> +		clk_disable_unprepare(priv->clk);
> +		return ret;
> +	}
> +
> +	return 0;
>  }
>  
>  static int socfpga_a10_fpga_remove(struct platform_device *pdev)
> -- 
> 2.7.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fpga" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Thanks for your patch,

Moritz

  reply	other threads:[~2017-12-02  1:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-01 20:26 Alexey Khoroshilov
2017-12-02  1:21 ` Moritz Fischer [this message]
2017-12-04 15:44   ` Alan Tull
2017-12-08 17:36 [PATCH] patch for FPGA Alan Tull
2017-12-08 17:37 ` [PATCH] fpga: socfpga-a10: disable clk on error in socfpga_a10_fpga_probe() Alan Tull

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171202012108.x5js74t73f3wkpem@derp-derp.lan \
    --to=mdf@kernel.org \
    --cc=atull@kernel.org \
    --cc=khoroshilov@ispras.ru \
    --cc=ldv-project@linuxtesting.org \
    --cc=linux-fpga@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®