From patchwork Fri Jan 23 13:00:29 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?R=C3=A9mi_Denis-Courmont?= X-Patchwork-Id: 20043 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id B1F25DDF7F for ; Sat, 24 Jan 2009 00:00:44 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755631AbZAWNAk (ORCPT ); Fri, 23 Jan 2009 08:00:40 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755513AbZAWNAk (ORCPT ); Fri, 23 Jan 2009 08:00:40 -0500 Received: from smtp.nokia.com ([192.100.122.233]:50721 "EHLO mgw-mx06.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755402AbZAWNAj (ORCPT ); Fri, 23 Jan 2009 08:00:39 -0500 Received: from esebh106.NOE.Nokia.com (esebh106.ntc.nokia.com [172.21.138.213]) by mgw-mx06.nokia.com (Switch-3.2.6/Switch-3.2.6) with ESMTP id n0ND0ETW011091 for ; Fri, 23 Jan 2009 15:00:36 +0200 Received: from esebh102.NOE.Nokia.com ([172.21.138.183]) by esebh106.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 23 Jan 2009 15:00:22 +0200 Received: from mgw-int01.ntc.nokia.com ([172.21.143.96]) by esebh102.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Fri, 23 Jan 2009 15:00:22 +0200 Received: from localhost.localdomain (esdhcp041160.research.nokia.com [172.21.41.160]) by mgw-int01.ntc.nokia.com (Switch-3.2.5/Switch-3.2.5) with ESMTP id n0ND0Fo8027886 for ; Fri, 23 Jan 2009 15:00:21 +0200 From: =?utf-8?q?R=C3=A9mi=20Denis-Courmont?= To: netdev@vger.kernel.org Subject: [PATCH 5/6] Phonet: remove useless locking in device cleanup Date: Fri, 23 Jan 2009 15:00:29 +0200 Message-Id: <1232715630-24951-5-git-send-email-remi.denis-courmont@nokia.com> X-Mailer: git-send-email 1.5.6.3 In-Reply-To: <200901231459.29743.remi.denis-courmont@nokia.com> References: <200901231459.29743.remi.denis-courmont@nokia.com> MIME-Version: 1.0 X-OriginalArrivalTime: 23 Jan 2009 13:00:22.0699 (UTC) FILETIME=[8D3E9FB0:01C97D5A] X-Nokia-AV: Clean Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Incoming packets and sockets are already gone. The netdevice notifier is unregistered under the RTNL lock There remains a race with the rtnetlink handlers unregistration, but it is a generic RTNL issue that was already present before this change. Signed-off-by: RĂ©mi Denis-Courmont --- net/phonet/pn_dev.c | 7 +------ 1 files changed, 1 insertions(+), 6 deletions(-) diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c index fd41810..3e24c05 100644 --- a/net/phonet/pn_dev.c +++ b/net/phonet/pn_dev.c @@ -204,13 +204,8 @@ void phonet_device_exit(void) struct phonet_device *pnd, *n; rtnl_unregister_all(PF_PHONET); - rtnl_lock(); - spin_lock_bh(&pndevs.lock); + unregister_netdevice_notifier(&phonet_device_notifier); list_for_each_entry_safe(pnd, n, &pndevs.list, list) __phonet_device_free(pnd); - - spin_unlock_bh(&pndevs.lock); - rtnl_unlock(); - unregister_netdevice_notifier(&phonet_device_notifier); }