summaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorChuanxiao Dong <chuanxiao.dong@intel.com>2016-01-21 13:57:51 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-04-03 06:23:17 +0200
commit282d5f0567be5abcc57a38ada569460ef63b5be9 (patch)
tree90cd4e24e1dd11b5d725efe016662298b4c4364d /drivers/mmc
parentc8816bb0ed6dc34c888021a34891385c0a84566f (diff)
mmc: debugfs: Add a restriction to mmc debugfs clock setting
commit e5905ff1281f0a0f5c9863c430ac1ed5faaf5707 upstream. Clock frequency values written to an mmc host should not be less than the minimum clock frequency which the mmc host supports. Signed-off-by: Yuan Juntao <juntaox.yuan@intel.com> Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/core/debugfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c
index 154aced0b91b..705586dcd9fa 100644
--- a/drivers/mmc/core/debugfs.c
+++ b/drivers/mmc/core/debugfs.c
@@ -220,7 +220,7 @@ static int mmc_clock_opt_set(void *data, u64 val)
struct mmc_host *host = data;
/* We need this check due to input value is u64 */
- if (val > host->f_max)
+ if (val != 0 && (val > host->f_max || val < host->f_min))
return -EINVAL;
mmc_claim_host(host);