All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Sinan Kaya <okaya@kernel.org>
Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	agross@kernel.org, bjorn.andersson@linaro.org, vkoul@kernel.org,
	dan.j.williams@intel.com, linux-arm-kernel@lists.infradead.org,
	linux-arm-msm@vger.kernel.org, dmaengine@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] dmaengine: qcom_hidma: Simplify error handling path in hidma_probe
Date: Tue, 28 Apr 2020 20:21:16 +0300	[thread overview]
Message-ID: <20200428172116.GG2014@kadam> (raw)
In-Reply-To: <1efa0186-7fbe-9cb5-2719-2d7192f99e27@kernel.org>

I apologize, I wrote my code hurriedly and did no explain the bug well.
I understood what the code is doing, but my fix was missing an if
condition.

On Tue, Apr 28, 2020 at 12:01:15PM -0400, Sinan Kaya wrote:
> On 4/28/2020 8:54 AM, Dan Carpenter wrote:
> >> @@ -897,7 +897,6 @@ static int hidma_probe(struct platform_device *pdev)
> >>  	if (msi)
> >             ^^^
> > This test doesn't work.  It will call free hidma_free_msis() if the
> > hidma_request_msi() call fails.  We should do:
> > 
> > 	if (msi) {
> > 		rc = hidma_request_msi(dmadev, pdev);
> > 		msi = false;

What I meant to say here was:

	if (msi) {
		rc = hidma_request_msi(dmadev, pdev);
		if (rc)
			msi = false;

Otherwise we end up checking freeing the msi in the error handling
code when we did not take it.

Hopefully, that clears things up?

regards,
dan carpenter


WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Sinan Kaya <okaya@kernel.org>
Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	agross@kernel.org, bjorn.andersson@linaro.org, vkoul@kernel.org,
	dan.j.williams@intel.com, linux-arm-kernel@lists.infradead.org,
	linux-arm-msm@vger.kernel.org, dmaengine@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] dmaengine: qcom_hidma: Simplify error handling path in hidma_probe
Date: Tue, 28 Apr 2020 17:21:16 +0000	[thread overview]
Message-ID: <20200428172116.GG2014@kadam> (raw)
In-Reply-To: <1efa0186-7fbe-9cb5-2719-2d7192f99e27@kernel.org>

I apologize, I wrote my code hurriedly and did no explain the bug well.
I understood what the code is doing, but my fix was missing an if
condition.

On Tue, Apr 28, 2020 at 12:01:15PM -0400, Sinan Kaya wrote:
> On 4/28/2020 8:54 AM, Dan Carpenter wrote:
> >> @@ -897,7 +897,6 @@ static int hidma_probe(struct platform_device *pdev)
> >>  	if (msi)
> >             ^^^
> > This test doesn't work.  It will call free hidma_free_msis() if the
> > hidma_request_msi() call fails.  We should do:
> > 
> > 	if (msi) {
> > 		rc = hidma_request_msi(dmadev, pdev);
> > 		msi = false;

What I meant to say here was:

	if (msi) {
		rc = hidma_request_msi(dmadev, pdev);
		if (rc)
			msi = false;

Otherwise we end up checking freeing the msi in the error handling
code when we did not take it.

Hopefully, that clears things up?

regards,
dan carpenter

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Sinan Kaya <okaya@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org, bjorn.andersson@linaro.org,
	vkoul@kernel.org, agross@kernel.org,
	Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	dmaengine@vger.kernel.org, dan.j.williams@intel.com,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] dmaengine: qcom_hidma: Simplify error handling path in hidma_probe
Date: Tue, 28 Apr 2020 20:21:16 +0300	[thread overview]
Message-ID: <20200428172116.GG2014@kadam> (raw)
In-Reply-To: <1efa0186-7fbe-9cb5-2719-2d7192f99e27@kernel.org>

I apologize, I wrote my code hurriedly and did no explain the bug well.
I understood what the code is doing, but my fix was missing an if
condition.

On Tue, Apr 28, 2020 at 12:01:15PM -0400, Sinan Kaya wrote:
> On 4/28/2020 8:54 AM, Dan Carpenter wrote:
> >> @@ -897,7 +897,6 @@ static int hidma_probe(struct platform_device *pdev)
> >>  	if (msi)
> >             ^^^
> > This test doesn't work.  It will call free hidma_free_msis() if the
> > hidma_request_msi() call fails.  We should do:
> > 
> > 	if (msi) {
> > 		rc = hidma_request_msi(dmadev, pdev);
> > 		msi = false;

What I meant to say here was:

	if (msi) {
		rc = hidma_request_msi(dmadev, pdev);
		if (rc)
			msi = false;

Otherwise we end up checking freeing the msi in the error handling
code when we did not take it.

Hopefully, that clears things up?

regards,
dan carpenter


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-04-28 17:23 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-27 11:10 [PATCH] dmaengine: qcom_hidma: Simplify error handling path in hidma_probe Christophe JAILLET
2020-04-27 11:10 ` Christophe JAILLET
2020-04-27 11:10 ` Christophe JAILLET
2020-04-27 16:08 ` Vinod Koul
2020-04-27 16:20   ` Vinod Koul
2020-04-27 16:08   ` Vinod Koul
2020-04-28 12:54 ` Dan Carpenter
2020-04-28 12:54   ` Dan Carpenter
2020-04-28 12:54   ` Dan Carpenter
2020-04-28 16:01   ` Sinan Kaya
2020-04-28 16:01     ` Sinan Kaya
2020-04-28 16:01     ` Sinan Kaya
2020-04-28 17:21     ` Dan Carpenter [this message]
2020-04-28 17:21       ` Dan Carpenter
2020-04-28 17:21       ` Dan Carpenter
2020-04-28 20:29       ` Sinan Kaya
2020-04-28 20:29         ` Sinan Kaya
2020-04-28 20:29         ` Sinan Kaya

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=20200428172116.GG2014@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=okaya@kernel.org \
    --cc=vkoul@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.