From patchwork Sat Mar 13 07:00:45 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jing Zhang X-Patchwork-Id: 85704 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 o2D70ngA000575 for ; Sat, 13 Mar 2010 07:00:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758852Ab0CMHAq (ORCPT ); Sat, 13 Mar 2010 02:00:46 -0500 Received: from mail-yw0-f198.google.com ([209.85.211.198]:36502 "EHLO mail-yw0-f198.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758844Ab0CMHAq (ORCPT ); Sat, 13 Mar 2010 02:00:46 -0500 Received: by ywh36 with SMTP id 36so776848ywh.4 for ; Fri, 12 Mar 2010 23:00:45 -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=/FciiLVhuqk9yxenrVo6D/zcAGv6R6a88faGGoSCbAM=; b=mJ7RRWdtzZVJIiTjZgoUNld9SjAm0FXLHECp2FYozXRlcJ4WWWpf8rJmyuUHghuBIv VC4aqrbakr+sepxZPwADdGLPj0w8i0ec+S5VsUX3i+wQ0ajQw18nKfwx+KKXQ/LkwR1c 7BcxAvdBQwIvSWYgaenJ6w82BSZzgCYa1nPpk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=nsGQQFWK4/3xnyZCmyBx3mArmNo1on7PZ7UjPBD/yN4VyPBWYUDJUvttJEkdDJDI0K hUU2FGIq04zrHm5A9OmRcC6HAnSzmPIP341nVnUZe5ny/T9Npl14mKfwODB34xkYRZI3 ZCz2Dq+FZywDOI943bdTl6VuKzakeKdcRY/L4= MIME-Version: 1.0 Received: by 10.101.166.26 with SMTP id t26mr2841448ano.121.1268463645078; Fri, 12 Mar 2010 23:00:45 -0800 (PST) Date: Sat, 13 Mar 2010 15:00:45 +0800 Message-ID: Subject: [PATCH] kvm: clean up assigned_device_enable_host_msix From: jing zhang To: kvm-devel Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@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, 13 Mar 2010 07:00:56 +0000 (UTC) --- a/virt/kvm/assigned-dev.c 2010-03-02 20:10:18.000000000 +0800 +++ b/virt/kvm/assigned-dev.c 2010-03-02 20:26:18.000000000 +0800 @@ -315,12 +315,16 @@ static int assigned_device_enable_host_m kvm_assigned_dev_intr, 0, "kvm_assigned_msix_device", (void *)dev); - /* FIXME: free requested_irq's on failure */ if (r) - return r; + goto err; } return 0; +err: + for (i -= 1; i >= 0; i--) + free_irq(dev->host_msix_entries[i].vector, (void *)dev); + pci_disable_msix(dev->dev); + return r; } #endif