All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Javier Martinez Canillas <javier.martinez@collabora.co.uk>,
	Dan Williams <dan.j.williams@intel.com>
Cc: Vinod Koul <vinod.koul@intel.com>,
	dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] dmaengine: pl330: Check if the DMA descriptor is NULL
Date: Sun, 20 Jul 2014 16:18:39 +0200	[thread overview]
Message-ID: <53CBCFBF.1040208@metafoo.de> (raw)
In-Reply-To: <1405732907-30964-1-git-send-email-javier.martinez@collabora.co.uk>

On 07/19/2014 03:21 AM, Javier Martinez Canillas wrote:
> Commit 6079d38 ("dmaengine: pl330: Remove useless xfer_cb indirection")
> removed the __callback() function which created an unnecessary level of
> indirection to execute the tranfer callback .xfer_cb
>
> Unfortunately the commit also changed the semantics slightly since that
> function used to check if the request was not NULL before attempting to
> execute the callback function. Not checking this could lead to a kernel
> NULL pointer dereference error.

This should not happen, but I guess it can happen when terminal_all() is 
called. (It's wrong to try to complete a descriptor from terminal_all() in 
the first place, but that's a different issue)

>
> Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>

Acked-by: Lars-Peter Clausen <lars@metafoo.de>

> ---
>   drivers/dma/pl330.c | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
> index bc5878a..a55d754 100644
> --- a/drivers/dma/pl330.c
> +++ b/drivers/dma/pl330.c
> @@ -1441,9 +1441,14 @@ xfer_exit:
>
>   static void dma_pl330_rqcb(struct dma_pl330_desc *desc, enum pl330_op_err err)
>   {
> -	struct dma_pl330_chan *pch = desc->pchan;
> +	struct dma_pl330_chan *pch;
>   	unsigned long flags;
>
> +	if (!desc)
> +		return;
> +
> +	pch = desc->pchan;
> +
>   	/* If desc aborted */
>   	if (!pch)
>   		return;
>


  reply	other threads:[~2014-07-20 14:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-19  1:21 [PATCH 1/1] dmaengine: pl330: Check if the DMA descriptor is NULL Javier Martinez Canillas
2014-07-20 14:18 ` Lars-Peter Clausen [this message]
2014-07-20 17:58   ` Javier Martinez Canillas
2014-07-21  8:22     ` Lars-Peter Clausen
2014-07-21  8:44       ` Javier Martinez Canillas
2014-07-22 16:09 ` Vinod Koul

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=53CBCFBF.1040208@metafoo.de \
    --to=lars@metafoo.de \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=javier.martinez@collabora.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vinod.koul@intel.com \
    /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.