Hi Prabhakar,

On 23 January 2014 15:26, Prabhakar Lad <prabhakar.cse...@gmail.com> wrote:
> From: "Lad, Prabhakar" <prabhakar.cse...@gmail.com>
>
> In the gen_pool_dma_alloc() the dma pointer can be NULL
> and while assigning gen_pool_virt_to_phys(pool, vaddr) to
> dma caused the following crash on da850 evm,
>
[snip]
>
> Signed-off-by: Lad, Prabhakar <prabhakar.cse...@gmail.com>
> ---
>  lib/genalloc.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/lib/genalloc.c b/lib/genalloc.c
> index dda3116..f48163f 100644
> --- a/lib/genalloc.c
> +++ b/lib/genalloc.c
> @@ -334,7 +334,8 @@ void *gen_pool_dma_alloc(struct gen_pool *pool, size_t 
> size, dma_addr_t *dma)
>         if (!vaddr)
>                 return NULL;
>
> -       *dma = gen_pool_virt_to_phys(pool, vaddr);
> +       if (dma)
> +               *dma = gen_pool_virt_to_phys(pool, vaddr);

Wouldn't it be better to return (with error/message) if dma is NULL
rather than silently ignore it?

>
>         return (void *)vaddr;


-- 
With warm regards,
Sachin
_______________________________________________
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to