lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1453954889-6290-1-git-send-email-zhang.chunyan@linaro.org>
Date:	Thu, 28 Jan 2016 12:21:29 +0800
From:	Chunyan Zhang <zhang.chunyan@...aro.org>
To:	alexander.shishkin@...ux.intel.com
Cc:	linux-kernel@...r.kernel.org, mathieu.poirier@...aro.org,
	zhang.lyra@...il.com
Subject: [PATCH] drivers: stm: correct the index in master array release

It would be broken if stm_data->sw_start isn't zero, because that
stp_master_free() get the 'master' with __stm_master()/stm_master(),
in which the masterID is the second input parameter minus
stm_data->sw_start. So freeing STM masters has to start from
stm_data->sw_start.

Signed-off-by: Chunyan Zhang <zhang.chunyan@...aro.org>
---
 drivers/hwtracing/stm/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm/core.c
index da53b5d..80e7b5e 100644
--- a/drivers/hwtracing/stm/core.c
+++ b/drivers/hwtracing/stm/core.c
@@ -718,7 +718,7 @@ void stm_unregister_device(struct stm_data *stm_data)
 		stp_policy_unbind(stm->policy);
 	mutex_unlock(&stm->policy_mutex);
 
-	for (i = 0; i < stm->sw_nmasters; i++)
+	for (i = stm->data->sw_start; i <= stm->data->sw_end; i++)
 		stp_master_free(stm, i);
 
 	device_unregister(&stm->dev);
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ