DMA: OF: Check properties value before running be32_to_cpup() on it
authorViresh Kumar <viresh.kumar@linaro.org>
Fri, 15 Mar 2013 08:48:20 +0000 (14:18 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 19 May 2013 18:38:15 +0000 (11:38 -0700)
commit82d72f05272eaf6ea37d63673069ce0f0dd8387a
tree4b49c066ec8252d1b4d6f04ed46297c1a04a3be3
parent7a6ff79b0370eb1d5036e8a35df2f5adea385c51
DMA: OF: Check properties value before running be32_to_cpup() on it

commit 9a188eb126aa7bf27077ee46fcb914898d6fc281 upstream.

In of_dma_controller_register() routine we are calling of_get_property() as an
parameter to be32_to_cpup(). In case the property doesn't exist we will get a
crash.

This patch changes this code to check if we got a valid property first and then
runs be32_to_cpup() on it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Robert Richter <robert.richter@calxeda.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/dma/of-dma.c