Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] rc: ite-cir: fix potential double free in ite_probe()

Since rc_unregister_device() frees its argument, the subsequently
call to rc_free_device() on the same variable will cause a double
free bug. Fix by set argument to NULL, thus when fall through to
rc_free_device(), nothing will be done there.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

authored by

Wei Yongjun and committed by
Mauro Carvalho Chehab
408208fb 4ec16da7

+1
+1
drivers/media/rc/ite-cir.c
··· 1613 1613 release_region(itdev->cir_addr, itdev->params.io_region_size); 1614 1614 exit_unregister_device: 1615 1615 rc_unregister_device(rdev); 1616 + rdev = NULL; 1616 1617 exit_free_dev_rdev: 1617 1618 rc_free_device(rdev); 1618 1619 kfree(itdev);