Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5944d64a authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "drivers: soc: qcom: rpm_stats: Fix uninitialized buffer usage"

parents 93070859 92875d96
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
/* Copyright (c) 2011-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-2017, 2019, 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
@@ -389,7 +389,7 @@ static ssize_t rpmstats_show(struct kobject *kobj,
{
	struct msm_rpmstats_private_data *prvdata = NULL;
	struct msm_rpmstats_platform_data *pdata = NULL;
	ssize_t ret;
	ssize_t ret = 0;

	mutex_lock(&rpm_stats_mutex);
	pdata = GET_PDATA_OF_ATTR(attr);
@@ -428,9 +428,12 @@ static ssize_t rpmstats_show(struct kobject *kobj,
		else if (prvdata->platform_data->version == 2)
			prvdata->len = msm_rpmstats_copy_stats_v2(
					prvdata);
		else
			goto exit;
	}

	ret = snprintf(buf, prvdata->len, "%s", prvdata->buf);
exit:
	iounmap(prvdata->reg_base);
ioremap_fail:
	kfree(prvdata);