Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1e071039 authored by Santosh Kumar Singh's avatar Santosh Kumar Singh Committed by Mauro Carvalho Chehab
Browse files

[media] tm6000: Clean up file handle in open() error path



Fix to avoid possible memory leak and exit file handle
in error paths.

Signed-off-by: default avatarSantosh Kumar Singh <kumar.san1093@gmail.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 2217a1d1
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1371,8 +1371,11 @@ static int __tm6000_open(struct file *file)

	/* initialize hardware on analog mode */
	rc = tm6000_init_analog_mode(dev);
	if (rc < 0)
	if (rc < 0) {
		v4l2_fh_exit(&fh->fh);
		kfree(fh);
		return rc;
	}

	dev->mode = TM6000_MODE_ANALOG;