From patchwork Fri Mar 1 00:43:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 15168 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 60C8B23E1A for ; Fri, 1 Mar 2013 00:44:00 +0000 (UTC) Received: from mail-ve0-f178.google.com (mail-ve0-f178.google.com [209.85.128.178]) by fiordland.canonical.com (Postfix) with ESMTP id 173D3A1935F for ; Fri, 1 Mar 2013 00:43:59 +0000 (UTC) Received: by mail-ve0-f178.google.com with SMTP id db10so2411020veb.23 for ; Thu, 28 Feb 2013 16:43:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=iJLJKtfNjM0OCVFSFsja/8dnHiUiG1X3cdX02qE1Qnw=; b=Ppgcr9vfkgZuyo2qIIMGcAgwWVJ46G7h3qsDIWdX+Yhvoilec8zxHOh7hmXNVKaTSB o5HIxkdggmOVpD2bkodPCyRPEV45ZjAhlIX+ft9MRuDz/5DXswz9ZomgQFrDHeftuUKx /pkTnfvxMRQ4m9KAaW0ySqR87cjm9YmpwR3sJ2CA7HimGgAkLhmOX1K1u+NcO2ALsL+3 wbZY6pqrdg64aFudZ07gNdD4z4ljXg2TpjgtD7v1G97c8S1Q3ODDLMZoCPPR8Yf1Ij7n yZIbFH+gSv0DU3Dfe9KEXSdQiyT6uqkxzTobJtscIWrAse4Ur66KqFqPyR52AgxR54b3 p4fA== X-Received: by 10.52.88.237 with SMTP id bj13mr2902305vdb.75.1362098639566; Thu, 28 Feb 2013 16:43:59 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.145.101 with SMTP id st5csp651veb; Thu, 28 Feb 2013 16:43:59 -0800 (PST) X-Received: by 10.68.26.234 with SMTP id o10mr11740480pbg.211.1362098638676; Thu, 28 Feb 2013 16:43:58 -0800 (PST) Received: from mail-pb0-f42.google.com (mail-pb0-f42.google.com [209.85.160.42]) by mx.google.com with ESMTPS id nq5si10242460pbc.326.2013.02.28.16.43.58 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 28 Feb 2013 16:43:58 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.42 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) client-ip=209.85.160.42; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.42 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) smtp.mail=john.stultz@linaro.org Received: by mail-pb0-f42.google.com with SMTP id xb4so1389971pbc.1 for ; Thu, 28 Feb 2013 16:43:58 -0800 (PST) X-Received: by 10.66.182.134 with SMTP id ee6mr16211467pac.117.1362098638107; Thu, 28 Feb 2013 16:43:58 -0800 (PST) Received: from localhost.localdomain (c-24-21-54-107.hsd1.or.comcast.net. [24.21.54.107]) by mx.google.com with ESMTPS id dx17sm10914892pac.17.2013.02.28.16.43.56 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 28 Feb 2013 16:43:57 -0800 (PST) From: John Stultz To: lkml Cc: Erik Gilling , Maarten Lankhorst , Daniel Vetter , Rob Clark , Sumit Semwal , Greg KH , dri-devel@lists.freedesktop.org, Android Kernel Team , John Stultz Subject: [PATCH 12/30] staging: sync: Reorder sync_fence_release Date: Thu, 28 Feb 2013 16:43:08 -0800 Message-Id: <1362098606-26469-13-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1362098606-26469-1-git-send-email-john.stultz@linaro.org> References: <1362098606-26469-1-git-send-email-john.stultz@linaro.org> X-Gm-Message-State: ALoCoQns6dPvagLGwVYiRF09vioXK6j8tbqUu+HwgAlalda0f5SSEJ4JFJlofmv4/4QD8Un1BZfn From: Erik Gilling Previously fence's pts were freed before the were the fence was removed from the global fence list. This led to a race with the debugfs support where it would iterate over sync_pts that had been freed. Cc: Maarten Lankhorst Cc: Erik Gilling Cc: Daniel Vetter Cc: Rob Clark Cc: Sumit Semwal Cc: Greg KH Cc: dri-devel@lists.freedesktop.org Cc: Android Kernel Team Signed-off-by: Erik Gilling Signed-off-by: John Stultz --- drivers/staging/android/sync.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c index 6739a84..2afbd69 100644 --- a/drivers/staging/android/sync.c +++ b/drivers/staging/android/sync.c @@ -520,12 +520,12 @@ static int sync_fence_release(struct inode *inode, struct file *file) struct sync_fence *fence = file->private_data; unsigned long flags; - sync_fence_free_pts(fence); - spin_lock_irqsave(&sync_fence_list_lock, flags); list_del(&fence->sync_fence_list); spin_unlock_irqrestore(&sync_fence_list_lock, flags); + sync_fence_free_pts(fence); + kfree(fence); return 0;