NetBSD Problem Report #48592
From www@NetBSD.org Wed Feb 12 08:46:04 2014
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
by mollari.NetBSD.org (Postfix) with ESMTPS id 86CEAA646F
for <gnats-bugs@gnats.NetBSD.org>; Wed, 12 Feb 2014 08:46:04 +0000 (UTC)
Message-Id: <20140212084603.5DBB9A64AE@mollari.NetBSD.org>
Date: Wed, 12 Feb 2014 08:46:03 +0000 (UTC)
From: k-nakahara@iij.ad.jp
Reply-To: k-nakahara@iij.ad.jp
To: gnats-bugs@NetBSD.org
Subject: cpufreq_get_state_index() unlock wrong lock
X-Send-Pr-Version: www-1.0
>Number: 48592
>Category: kern
>Synopsis: cpufreq_get_state_index() unlock wrong lock
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: kern-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Feb 12 08:50:00 +0000 2014
>Closed-Date: Wed Feb 12 20:21:03 +0000 2014
>Last-Modified: Wed Feb 12 20:25:00 +0000 2014
>Originator: Kengo NAKAHARA
>Release: current
>Organization:
>Environment:
NetBSD dtrace-test.iij.ad.jp 6.1.2 NetBSD 6.1.2 (DTRACE) #101: Wed Feb 12 00:09:46 UTC 2014 k-nakahara@dtrace-test.iij.ad.jp:/home/k-nakahara/netbsd_src/6.1.2/usr/obj/sys/arch/amd64/compile/DTRACE amd64
>Description:
cpufreq_get_state_index() lock "cpufreq_lock", but unlock "cpu_lock".
>How-To-Repeat:
>Fix:
--- kern/subr_cpufreq.c.orig 2014-02-12 08:44:27.000000000 +0000
+++ kern/subr_cpufreq.c 2014-02-12 08:44:42.000000000 +0000
@@ -361,7 +361,7 @@
}
if (index >= cf->cf_state_count) {
- mutex_exit(&cpu_lock);
+ mutex_exit(&cpufreq_lock);
return EINVAL;
}
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed
State-Changed-By: martin@NetBSD.org
State-Changed-When: Wed, 12 Feb 2014 20:21:03 +0000
State-Changed-Why:
Applied, thanks for the patch!
From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/48592 CVS commit: src/sys/kern
Date: Wed, 12 Feb 2014 20:20:15 +0000
Module Name: src
Committed By: martin
Date: Wed Feb 12 20:20:15 UTC 2014
Modified Files:
src/sys/kern: subr_cpufreq.c
Log Message:
Unlock correct mutex in an error path.
PR kern/48592 from Kengo NAKAHARA.
To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/kern/subr_cpufreq.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.