OSDN Git Service

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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jun 2017 13:05:57 +0000 (15:05 +0200)
commitf08c84d4c7450135ccd90e7d4ce10335d998ea6f
treed95de9b6f572612630bbf33e83e578c497e16072
parentf2e9d10bf1a21a982ee179bab798e3801eb410af
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