dmaengine: mv_xor_v2: handle mv_xor_v2_prep_sw_desc() error properly
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Fri, 5 May 2017 09:57:44 +0000 (11:57 +0200)
committerRaspbian kernel package updater <root@raspbian.org>
Sun, 23 Jul 2017 02:55:12 +0000 (02:55 +0000)
commit1533b0a458f317b1af9be0692f8693cb7799d2a2
treebcd0c912a49d55aa86fcdde4f122f02edc3b06ad
parent5d1daa5e8692648069385da569afddf2f482bdd3
dmaengine: mv_xor_v2: handle mv_xor_v2_prep_sw_desc() error properly

commit eb8df543e444492328f506adffc7dfe94111f1bd upstream.

The mv_xor_v2_prep_sw_desc() is called from a few different places in
the driver, but we never take into account the fact that it might
return NULL. This commit fixes that, ensuring that we don't panic if
there are no more descriptors available.

Fixes: 19a340b1a820 ("dmaengine: mv_xor_v2: new driver")
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/dma/mv_xor_v2.c