Skip to content
  • Stefan Roese's avatar
    dmaengine: dmatest: Add check for supported buffer count (sg_buffers) · fbfb8e1d
    Stefan Roese authored
    
    
    When using dmatest with sg_buffers=128 I stumbled upon the problem, that
    the "map_cnt" variable of "struct dmaengine_unmap_data" was set to 0.
    "map_cnt" is an "u8" variable, resulting in an overrun when its
    value is set to src_cnt + dst_cnt, to twice the sg_buffer value.
    
    This patch adds a small check to dmatest, so that this confusing error
    is detected and the test is aborted.
    
    Signed-off-by: default avatarStefan Roese <sr@denx.de>
    Cc: Kedareswara rao Appana <appanad@xilinx.com>
    Cc: Vinod Koul <vinod.koul@intel.com>
    Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
    fbfb8e1d