dmaengine: mv_xor: fix oops when channels fail to initialise
authorRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 12 Dec 2013 23:59:08 +0000 (23:59 +0000)
committerDan Williams <dan.j.williams@intel.com>
Fri, 13 Dec 2013 06:48:53 +0000 (22:48 -0800)
commit0be8253fa2b4385e6246387db1d6067366e987ba
treee798be82ec569d306f4eae19a4c87544b30fb3b8
parentd16695a75019ac4baad7a117dc86d1d292e09115
dmaengine: mv_xor: fix oops when channels fail to initialise

When a channel fails to initialise, we error out and clean up any
previously unregistered channels by walking the entire xordev->channels
array.  Unfortunately, there are paths which end up storing an error
pointer in this array, which we then try and dereference in the cleanup
code, which causes an oops.

Fix this by avoiding writing invalid pointers to this array in the first
place.

Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/dma/mv_xor.c