From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Garzik Subject: Re: [PATCH 2/7] drivers/net/ehea/ehea_main.c: Release mutex in error handling code Date: Wed, 30 Jul 2008 17:23:50 -0400 Message-ID: <4890DBE6.4080408@pobox.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: raisch@de.ibm.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org To: Julia Lawall Return-path: Received: from srv5.dvmed.net ([207.36.208.214]:57050 "EHLO mail.dvmed.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752491AbYG3VYA (ORCPT ); Wed, 30 Jul 2008 17:24:00 -0400 In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: Julia Lawall wrote: > From: Julia Lawall > > The mutex is released on a successful return, so it would seem that it > should be released on an error return as well. > > The semantic patch finds this problem is as follows: > (http://www.emn.fr/x-info/coccinelle/) > > // > @@ > expression l; > @@ > > mutex_lock(l); > ... when != mutex_unlock(l) > when any > when strict > ( > if (...) { ... when != mutex_unlock(l) > + mutex_unlock(l); > return ...; > } > | > mutex_unlock(l); > ) > // > > Signed-off-by: Julia Lawall applied