summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShu Zhong <shuz@nvidia.com>2014-07-01 10:25:57 -0700
committerWinnie Hsu <whsu@nvidia.com>2015-01-29 22:00:41 -0800
commit7834a7a15b4086d98d97c0fcf69713c6f8c9e625 (patch)
tree6875f83115e6c5f2bc941483cd30ac9b47707d74
parent3ab290755e0be6b207a5cd79f507c456195bba58 (diff)
misc: tegra-profiler: rd_alloc
quadd_unwind_start calls rd_alloc while holding a spinlock. This is dangerous because rd_alloc allocates memory with the GFP_KERNEL flag. This fix simply moves rd_alloc outside the critical section. Bug 1529894 Bug 1598009 Change-Id: I284e72d2fdd9089428d75f3c3efb79513a897b7e Signed-off-by: Shu Zhong <shuz@nvidia.com> Reviewed-on: http://git-master/r/433264 (cherry picked from commit e29a862f449b3f1831410162c4360041438017dc) Reviewed-on: http://git-master/r/672012 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Igor Nabirushkin <inabirushkin@nvidia.com> Tested-by: Igor Nabirushkin <inabirushkin@nvidia.com> Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
-rw-r--r--drivers/misc/tegra-profiler/eh_unwind.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/misc/tegra-profiler/eh_unwind.c b/drivers/misc/tegra-profiler/eh_unwind.c
index ae3b0d0dd195..70ffebe8bb72 100644
--- a/drivers/misc/tegra-profiler/eh_unwind.c
+++ b/drivers/misc/tegra-profiler/eh_unwind.c
@@ -1,7 +1,7 @@
/*
* drivers/misc/tegra-profiler/exh_tables.c
*
- * Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@@ -1125,6 +1125,7 @@ quadd_is_ex_entry_exist(struct pt_regs *regs,
int quadd_unwind_start(struct task_struct *task)
{
struct regions_data *rd, *rd_old;
+ rd = rd_alloc(QUADD_EXTABS_SIZE);
spin_lock(&ctx.lock);
@@ -1132,7 +1133,6 @@ int quadd_unwind_start(struct task_struct *task)
if (rd_old)
pr_warn("%s: warning: rd_old\n", __func__);
- rd = rd_alloc(QUADD_EXTABS_SIZE);
if (IS_ERR_OR_NULL(rd)) {
pr_err("%s: error: rd_alloc\n", __func__);
spin_unlock(&ctx.lock);