summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-08-07 23:22:43 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-08-07 23:22:43 -0700
commit2ef02c02c4834e0a64acff5ee39852edea506347 (patch)
treefda82275f78ef823976f537851c84969f79761af
parenta010a65c23553c67dee5fbdb89bc15851927f8b1 (diff)
parentfebb3a56566553b94074641d3808fe378bdf08b5 (diff)
Merge "qcom: ssr: Fix possible overflow when copying firmware name"
-rw-r--r--drivers/soc/qcom/subsystem_restart.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/soc/qcom/subsystem_restart.c b/drivers/soc/qcom/subsystem_restart.c
index 32041c17d88f..0ed8a6533e00 100644
--- a/drivers/soc/qcom/subsystem_restart.c
+++ b/drivers/soc/qcom/subsystem_restart.c
@@ -268,7 +268,8 @@ static ssize_t firmware_name_store(struct device *dev,
pr_info("Changing subsys fw_name to %s\n", buf);
mutex_lock(&track->lock);
- strlcpy(subsys->desc->fw_name, buf, count + 1);
+ strlcpy(subsys->desc->fw_name, buf,
+ min(count + 1, sizeof(subsys->desc->fw_name)));
mutex_unlock(&track->lock);
return orig_count;
}