Re: [PATCH] dmaengine: vdma: don't crash when bad channel is requested

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Franck,

Thank you for th patch.

On Tuesday 22 Mar 2016 11:52:22 Franck Jullien wrote:
> When client request a non existing channel from of_dma_xilinx_xlate
> we get a NULL pointer dereferencing. This patch fix this problem.
> 
> Signed-off-by: Franck Jullien <franck.jullien@xxxxxxxxxxxxxxxxxxx>

Acked-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>

> ---
>  drivers/dma/xilinx/xilinx_vdma.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/dma/xilinx/xilinx_vdma.c
> b/drivers/dma/xilinx/xilinx_vdma.c index 0ee0321..ef67f27 100644
> --- a/drivers/dma/xilinx/xilinx_vdma.c
> +++ b/drivers/dma/xilinx/xilinx_vdma.c
> @@ -1236,7 +1236,7 @@ static struct dma_chan *of_dma_xilinx_xlate(struct
> of_phandle_args *dma_spec, struct xilinx_vdma_device *xdev =
> ofdma->of_dma_data;
>  	int chan_id = dma_spec->args[0];
> 
> -	if (chan_id >= XILINX_VDMA_MAX_CHANS_PER_DEVICE)
> +	if (chan_id >= XILINX_VDMA_MAX_CHANS_PER_DEVICE || !xdev->chan[chan_id])
>  		return NULL;
> 
>  	return dma_get_slave_channel(&xdev->chan[chan_id]->common);

-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux PCI]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux