summaryrefslogtreecommitdiff
path: root/drivers/media/radio/CG2900/cg2900_fm_driver.c
diff options
context:
space:
mode:
authoranupam roy <anupam.roy@stericsson.com>2011-10-18 21:11:18 +0530
committerPhilippe Langlais <philippe.langlais@stericsson.com>2012-05-22 11:06:02 +0200
commit09e5ba4ee118f7019157062184aeeb6c83e2f8be (patch)
tree5c73b0bde145ce0c1da266480bb25bf685586f19 /drivers/media/radio/CG2900/cg2900_fm_driver.c
parent253a6fbf6c5a5a4b49600972b4f50e73e8c83b88 (diff)
CG2900 FM Radio: Improper RDS Thread handling.
This patch fixes the thread leak issue from CG2900 FM kernel driver by proper handling of RDS threads. ST-Ericsson Linux next: NA ST-Ericsson ID: 365795 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I277dae0e74f4115db2b0f734dd7f6361678b9502 Signed-off-by: anupam roy <anupam.roy@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/34400 Reviewed-by: QATOOLS Reviewed-by: Anurag SRIVASTAVA <anurag.srivastava@stericsson.com> Reviewed-by: Johan PALMAEUS <johan.xj.palmaeus@stericsson.com> Reviewed-by: Hemant GUPTA <hemant.gupta@stericsson.com>
Diffstat (limited to 'drivers/media/radio/CG2900/cg2900_fm_driver.c')
-rw-r--r--drivers/media/radio/CG2900/cg2900_fm_driver.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/media/radio/CG2900/cg2900_fm_driver.c b/drivers/media/radio/CG2900/cg2900_fm_driver.c
index 1d3a2552da2..4b1d39839ae 100644
--- a/drivers/media/radio/CG2900/cg2900_fm_driver.c
+++ b/drivers/media/radio/CG2900/cg2900_fm_driver.c
@@ -1154,6 +1154,8 @@ static int fmd_rds_thread(
/* Give 100 ms for context switching */
schedule_timeout_interruptible(msecs_to_jiffies(100));
}
+ /* Always signal the rds_sem semaphore before exiting */
+ fmd_set_rds_sem();
FM_DEBUG_REPORT("fmd_rds_thread Exiting!!!");
return 0;
}
@@ -4667,6 +4669,9 @@ void fmd_stop_rds_thread(void)
sema_init(&rds_sem, 0);
cb_rds_func = NULL;
rds_thread_required = false;
+ /* Wait for RDS thread to exit gracefully */
+ fmd_get_rds_sem();
+
if (rds_thread_task)
rds_thread_task = NULL;
}