diff options
| author | Linux Build Service Account <lnxbuild@quicinc.com> | 2017-05-16 06:49:27 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-05-16 06:49:27 -0700 |
| commit | 647e9bf427ff68ea7b48a499383fc133616e210a (patch) | |
| tree | 03dfbef1c1b519efe814cc7832d68d021eb496dd /drivers/soc | |
| parent | 40e4c19332cca1a2c7eb86cf498ab17c4a024204 (diff) | |
| parent | a9cab2670face9cf07e8197d7029de1cbbc001e3 (diff) | |
Merge "soc: qcom: rpm_master_stat: Fix buffer overflow"
Diffstat (limited to 'drivers/soc')
| -rw-r--r-- | drivers/soc/qcom/rpm_master_stat.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/soc/qcom/rpm_master_stat.c b/drivers/soc/qcom/rpm_master_stat.c index 14004a2b721e..7bf18ffe6ad2 100644 --- a/drivers/soc/qcom/rpm_master_stat.c +++ b/drivers/soc/qcom/rpm_master_stat.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2017, 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 @@ -96,6 +96,7 @@ static int msm_rpm_master_copy_stats( int count, j = 0; char *buf; static DEFINE_MUTEX(msm_rpm_master_stats_mutex); + unsigned long active_cores; mutex_lock(&msm_rpm_master_stats_mutex); @@ -247,12 +248,11 @@ static int msm_rpm_master_copy_stats( record.active_cores); } - j = find_first_bit((unsigned long *)&record.active_cores, - BITS_PER_LONG); + active_cores = record.active_cores; + j = find_first_bit(&active_cores, BITS_PER_LONG); while (j < BITS_PER_LONG) { SNPRINTF(buf, count, "\t\tcore%d\n", j); - j = find_next_bit((unsigned long *)&record.active_cores, - BITS_PER_LONG, j + 1); + j = find_next_bit(&active_cores, BITS_PER_LONG, j + 1); } master_cnt++; |
