From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932888AbbLTNUE (ORCPT ); Sun, 20 Dec 2015 08:20:04 -0500 Received: from terminus.zytor.com ([198.137.202.10]:49623 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754437AbbLTNTp (ORCPT ); Sun, 20 Dec 2015 08:19:45 -0500 Date: Sun, 20 Dec 2015 05:18:39 -0800 From: tip-bot for Thomas Gleixner Message-ID: Cc: Andy_Lowe@mentor.com, tglx@linutronix.de, hpa@zytor.com, linux-kernel@vger.kernel.org, darren@dvhart.com, dave@stgolabs.net, peterz@infradead.org, mingo@kernel.org Reply-To: tglx@linutronix.de, Andy_Lowe@mentor.com, linux-kernel@vger.kernel.org, darren@dvhart.com, dave@stgolabs.net, hpa@zytor.com, mingo@kernel.org, peterz@infradead.org In-Reply-To: <20151219200607.178132067@linutronix.de> References: <20151219200607.178132067@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:locking/core] futex: Drop refcount if requeue_pi() acquired the rtmutex Git-Commit-ID: fb75a4282d0d9a3c7c44d940582c2d226cf3acfb X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: fb75a4282d0d9a3c7c44d940582c2d226cf3acfb Gitweb: http://git.kernel.org/tip/fb75a4282d0d9a3c7c44d940582c2d226cf3acfb Author: Thomas Gleixner AuthorDate: Sat, 19 Dec 2015 20:07:38 +0000 Committer: Thomas Gleixner CommitDate: Sun, 20 Dec 2015 12:43:24 +0100 futex: Drop refcount if requeue_pi() acquired the rtmutex If the proxy lock in the requeue loop acquires the rtmutex for a waiter then it acquired also refcount on the pi_state related to the futex, but the waiter side does not drop the reference count. Add the missing free_pi_state() call. Signed-off-by: Thomas Gleixner Cc: Peter Zijlstra Cc: Darren Hart Cc: Davidlohr Bueso Cc: Bhuvanesh_Surachari@mentor.com Cc: Andy Lowe Link: http://lkml.kernel.org/r/20151219200607.178132067@linutronix.de Signed-off-by: Thomas Gleixner Cc: stable@vger.kernel.org --- kernel/futex.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel/futex.c b/kernel/futex.c index 684d754..24fbc77 100644 --- a/kernel/futex.c +++ b/kernel/futex.c @@ -2755,6 +2755,11 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, if (q.pi_state && (q.pi_state->owner != current)) { spin_lock(q.lock_ptr); ret = fixup_pi_state_owner(uaddr2, &q, current); + /* + * Drop the reference to the pi state which + * the requeue_pi() code acquired for us. + */ + free_pi_state(q.pi_state); spin_unlock(q.lock_ptr); } } else {