Re: questions about drivers/dma/amba-pl08x.c

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

On Tue, Apr 10, 2012 at 12:42 PM, Kassey Lee <kassey1216@xxxxxxxxx> wrote:

> hi, Linus, Walleij:
>        thanks for your answer! is this you meaning?

Sort of...

> Subject: [PATCH] dmaengine/amba-pl08x: check slave_channels to avoid kernel
>  panic
>
> slave_channels is platform dependent, it should
> be initialized by board.c, and here we need to check it
> to avoid a NULL panic.
>
> Signed-off-by: Kassey,Lee <kassey1216@xxxxxxxxx>
> ---
>  drivers/dma/amba-pl08x.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c
> index c301a8e..b558ea6 100644
> --- a/drivers/dma/amba-pl08x.c
> +++ b/drivers/dma/amba-pl08x.c
> @@ -1687,6 +1687,13 @@ static int
> pl08x_dma_init_virtual_channels(struct pl08x_driver_data *pl08x,
>                chan->state = PL08X_CHAN_IDLE;
>
>                if (slave) {
> +                       if (!pl08x->pd->slave_channels) {
> +                               dev_err(&pl08x->adev->dev,
> +                                       "%s slave_channels is
> +                                                not initialized\n", __func__);

Do not split messages for 80 col compliance. Ignore checkpatch warning in this
case.

> +                               kfree(chan);
> +                               return -EFAULT;

Use -EINVAL;

> +                       }

Thanks,
Linus Walleij

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



[Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [PDAs]     [Linux]     [Linux MIPS]     [Yosemite Campsites]     [Photos]

Add to Google Follow linuxarm on Twitter