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

Commit 723c9527 authored by Surajit Podder's avatar Surajit Podder Committed by Gerrit - the friendly Code Review server
Browse files

msm: vidc: Set file private data to NULL on close



Set file private data to NULL on closing instance
to avoid invalid access after close.

Change-Id: I447791463d9dbe32e25237256589bb07be2c3a32
Signed-off-by: default avatarSurajit Podder <spodder@codeaurora.org>
parent 8cf0b1c9
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -39,6 +39,8 @@ struct msm_vidc_drv *vidc_driver;

static inline struct msm_vidc_inst *get_vidc_inst(struct file *filp, void *fh)
{
	if (!filp->private_data)
		return NULL;
	return container_of(filp->private_data,
					struct msm_vidc_inst, event_handler);
}
@@ -74,6 +76,7 @@ static int msm_v4l2_close(struct file *filp)
	vidc_inst = get_vidc_inst(filp, NULL);

	rc = msm_vidc_close(vidc_inst);
	filp->private_data = NULL;
	trace_msm_v4l2_vidc_close_end("msm_v4l2_close end");
	return rc;
}