From patchwork Tue Nov 10 08:57:09 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 58975 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nAA8vSlV029990 for ; Tue, 10 Nov 2009 08:57:28 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753278AbZKJI5U (ORCPT ); Tue, 10 Nov 2009 03:57:20 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753222AbZKJI5U (ORCPT ); Tue, 10 Nov 2009 03:57:20 -0500 Received: from mail-bw0-f227.google.com ([209.85.218.227]:51209 "EHLO mail-bw0-f227.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752171AbZKJI5U (ORCPT ); Tue, 10 Nov 2009 03:57:20 -0500 Received: by bwz27 with SMTP id 27so4302065bwz.21 for ; Tue, 10 Nov 2009 00:57:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-x-sender:to:cc :subject:message-id:user-agent:mime-version:content-type; bh=1qkADV6RpKbMo1+Tzjfwnda0ibSKpXm6bNfajP/CNX8=; b=Cm5uJsvnJh6H47u+plER+hqgmipeuTSLbnaGREd2xRSn5ibdfVaLnhHOidUisATMQS aYNXIkSy/fITVjUU5hWtcT0Fuy+4FzUM6V7ZXiMOVg0qPKd8koQvIIVUcNoToEAXYW+u ELwhuvqgUzXtqvL4vGWqSZxBaIT0x/U5TUAa4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-x-sender:to:cc:subject:message-id:user-agent :mime-version:content-type; b=aubImAG6n+N9NbtH/Umjk/6yaRLLvKPbUS01moEE6lyKnw1y2vsz4Aj9MuuNMC/omd 9TelkC9ryT/PXz5LEvs8Y6GDXyuadF8AjoxMaHeOv7jZqf7wR2WfhLVhNJ/KlNwqa/hm nWYDo4VYih3JbX3IkRq0f1zfJxlZ+wF+tf/CA= Received: by 10.204.156.217 with SMTP id y25mr3738786bkw.76.1257843444591; Tue, 10 Nov 2009 00:57:24 -0800 (PST) Received: from bicker.local ([41.222.20.196]) by mx.google.com with ESMTPS id 14sm140024bwz.1.2009.11.10.00.57.20 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 10 Nov 2009 00:57:23 -0800 (PST) Date: Tue, 10 Nov 2009 10:57:09 +0200 (SAST) From: Dan Carpenter X-X-Sender: dcarpenter@bicker To: kvm@vger.kernel.org cc: avi@redhat.com, mtosatti@redhat.com Subject: [patch] add some unlocks on error paths irq_comm.c Message-ID: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org --- orig/virt/kvm/irq_comm.c 2009-11-08 19:00:50.000000000 +0200 +++ devel/virt/kvm/irq_comm.c 2009-11-08 19:04:45.000000000 +0200 @@ -209,6 +209,7 @@ sizeof(kvm->arch.irq_sources_bitmap)); if (irq_source_id >= sizeof(kvm->arch.irq_sources_bitmap)) { + mutex_unlock(&kvm->irq_lock); printk(KERN_WARNING "kvm: exhaust allocatable IRQ sources!\n"); return -EFAULT; } @@ -229,6 +230,7 @@ mutex_lock(&kvm->irq_lock); if (irq_source_id < 0 || irq_source_id >= sizeof(kvm->arch.irq_sources_bitmap)) { + mutex_unlock(&kvm->irq_lock); printk(KERN_ERR "kvm: IRQ source ID out of range!\n"); return; }