DMA: PL330: Check the pointer returned by kzalloc
authorSachin Kamat <sachin.kamat@linaro.org>
Mon, 17 Sep 2012 09:50:23 +0000 (15:20 +0530)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 10 Oct 2012 02:30:56 +0000 (03:30 +0100)
commitcd2ff82610f26dc1817effaed4627907fbe28079
tree43dc7e903f7359d481be4b32cc025c500c90cdfb
parentd912bb414b168204391f4a0fa8ae2e814c770fe8
DMA: PL330: Check the pointer returned by kzalloc

commit 61c6e7531d3b66b33187b8cdd700fd8ab93ffd62 upstream.

kzalloc could return NULL. Hence add a check to avoid
NULL pointer dereference.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Jassi Brar <jassisinghbrar@gmail.com>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
[bwh: Backported to 3.2: adjust context and error label]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/dma/pl330.c