From patchwork Mon Jul 13 21:23:39 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 29751 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 975C9B7089 for ; Tue, 14 Jul 2009 07:34:54 +1000 (EST) Received: by ozlabs.org (Postfix) id 89753DDDE6; Tue, 14 Jul 2009 07:34:54 +1000 (EST) 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 216BADDDE5 for ; Tue, 14 Jul 2009 07:34:54 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757502AbZGMVdJ (ORCPT ); Mon, 13 Jul 2009 17:33:09 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752642AbZGMVdI (ORCPT ); Mon, 13 Jul 2009 17:33:08 -0400 Received: from server1.wserver.cz ([82.113.45.157]:52905 "EHLO server1.wserver.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757462AbZGMVdH (ORCPT ); Mon, 13 Jul 2009 17:33:07 -0400 Received: from localhost.localdomain (unknown [82.113.46.245]) by server1.wserver.cz (Postfix) with ESMTP id 8B530C478E; Mon, 13 Jul 2009 23:29:38 +0200 (CEST) From: Jiri Slaby To: davem@davemloft.net Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jiri Slaby Subject: [PATCH 1/2] NET: phy_device, fix lock imbalance Date: Mon, 13 Jul 2009 23:23:39 +0200 Message-Id: <1247520220-31960-1-git-send-email-jirislaby@gmail.com> X-Mailer: git-send-email 1.6.3.2 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Don't forget to unlock a mutex in phy_scan_fixups on a fail path. Signed-off-by: Jiri Slaby --- drivers/net/phy/phy_device.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index eba937c..b10fedd 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -134,8 +134,10 @@ int phy_scan_fixups(struct phy_device *phydev) err = fixup->run(phydev); - if (err < 0) + if (err < 0) { + mutex_unlock(&phy_fixup_lock); return err; + } } } mutex_unlock(&phy_fixup_lock);