• Jesper Juhl's avatar
    [media] media, cx231xx: Fix double free on close · 266e8ae3
    Jesper Juhl authored
    In cx231xx_v4l2_close() there are two calls to
    cx231xx_release_resources(dev) followed by kfree(dev). That is a
    problem since cx231xx_release_resources() already kfree()'s its
    argument, so we end up doing a double free.
    
    Easily resolved by just removing the redundant kfree() calls after the
    calls to cx231xx_release_resources().
    
    I also changed the 'dev = NULL' assignments (which are rather
    pointless since 'dev' is about to go out of scope), to 'fh->dev = NULL'
    since it looks to me that that is what was actually intended.
    And I removed the 'dev = NULL' assignment at the end of
    cx231xx_release_resources() since it is pointless.
    Signed-off-by: default avatarJesper Juhl <jj@chaosbits.net>
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
    266e8ae3
cx231xx-cards.c 35.4 KB