From patchwork Sat Jan 30 21:56:30 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Skuczynski X-Patchwork-Id: 75927 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o0ULuXiG018088 for ; Sat, 30 Jan 2010 21:56:33 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753747Ab0A3V4c (ORCPT ); Sat, 30 Jan 2010 16:56:32 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753551Ab0A3V4c (ORCPT ); Sat, 30 Jan 2010 16:56:32 -0500 Received: from mail-bw0-f227.google.com ([209.85.218.227]:43992 "EHLO mail-bw0-f227.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751836Ab0A3V4b (ORCPT ); Sat, 30 Jan 2010 16:56:31 -0500 Received: by bwz27 with SMTP id 27so2233732bwz.21 for ; Sat, 30 Jan 2010 13:56:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=lLt+5mcqFuXOizDn0Ina9+QiK5wX7rf37Gyvv8pa9/4=; b=X7UaeF84izt+KZ0KOw8M+cbi3c05M/FCTuGziylgCJ0WALryEb0i95TNNoTW6m8ppJ 2hroiPexJMehv7V3uxe1GrtX2yrRMrjddFUN8htknknDOqCp/i55OlnybFMZpe1+lGd3 4jg7ZRt6NobX7/Oez4HJXgdYWLlDDzlAxXrB8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=e5Fx3IqljJTZNg14xd8Nsbx5dE4o38PLuGwFwL+JdEPOA8OHPzlxaQJhhrtAzpIgw1 vfqXDhC0vSIODBb3PqVrF3VM5QcFK0k0Da9x5o11gAof9lfZkkaAcE1Njc8SBQXA3LI5 PUp/c905DoxtXm6xqkzgN4bKISQfUlcDHCEiM= MIME-Version: 1.0 Received: by 10.204.25.197 with SMTP id a5mr1688773bkc.70.1264888590325; Sat, 30 Jan 2010 13:56:30 -0800 (PST) Date: Sat, 30 Jan 2010 22:56:30 +0100 Message-ID: Subject: Bug: access to already released memory From: Marek Skuczynski To: linux-sh@vger.kernel.org Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sat, 30 Jan 2010 21:56:33 +0000 (UTC) From d24a9cf204199f1bfb9215f5841192a1833f5fd7 Mon Sep 17 00:00:00 2001 From: Marek Skuczynski Date: Sat, 30 Jan 2010 22:29:32 +0100 Subject: [PATCH 2/2] sh: Fix access to released memory in clk_debugfs_register_one() Signed-off-by: Marek Skuczynski --- arch/sh/kernel/cpu/clock.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/sh/kernel/cpu/clock.c b/arch/sh/kernel/cpu/clock.c index f3a46be..83da5de 100644 --- a/arch/sh/kernel/cpu/clock.c +++ b/arch/sh/kernel/cpu/clock.c @@ -598,7 +598,7 @@ static struct dentry *clk_debugfs_root; static int clk_debugfs_register_one(struct clk *c) { int err; - struct dentry *d, *child; + struct dentry *d, *child, *child_tmp; struct clk *pa = c->parent; char s[255]; char *p = s; @@ -630,7 +630,7 @@ static int clk_debugfs_register_one(struct clk *c) err_out: d = c->dentry; - list_for_each_entry(child, &d->d_subdirs, d_u.d_child) + list_for_each_entry_safe(child, child_tmp, &d->d_subdirs, d_u.d_child) debugfs_remove(child); debugfs_remove(c->dentry); return err; -- 1.6.4.2