• Zhipeng Lu's avatar
    media: cx231xx: fix a memleak in cx231xx_init_isoc · 5d3c8990
    Zhipeng Lu authored
    The dma_q->p_left_data alloced by kzalloc should be freed in all the
    following error handling paths. However, it hasn't been freed in the
    allocation error paths of dev->video_mode.isoc_ctl.urb and
    dev->video_mode.isoc_ctl.transfer_buffer.
    
    On the other hand, the dma_q->p_left_data did be freed in the
    error-handling paths after that of dev->video_mode.isoc_ctl.urb and
    dev->video_mode.isoc_ctl.transfer_buffer, by calling
    cx231xx_uninit_isoc(dev). So the same free operation should be done in
    error-handling paths of those two allocation.
    
    Fixes: 64fbf444 ("[media] cx231xx: Added support for Carraera, Shelby, RDx_253S and VIDEO_GRABBER")
    Signed-off-by: default avatarZhipeng Lu <alexious@zju.edu.cn>
    Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
    5d3c8990
cx231xx-core.c 44.7 KB