From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759303AbcG1CKr (ORCPT ); Wed, 27 Jul 2016 22:10:47 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:34252 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759181AbcG1CKj (ORCPT ); Wed, 27 Jul 2016 22:10:39 -0400 From: Wei Yongjun To: Joerg Roedel Cc: Wei Yongjun , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: [PATCH -next] iommu/amd: Fix error return code in irq_remapping_alloc() Date: Thu, 28 Jul 2016 02:10:26 +0000 Message-Id: <1469671826-13144-1-git-send-email-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-TMASE-Version: CloudMessageScanner-0.0.0000-7.5.1021-22478.000 X-TMASE-Result: 10--3.789200-10.000000 X-TMASE-MatchedRID: QMfkO3kOl484tGBQPT0ZoZdc7I2df+msFTmqwD90nsLJYIv7y0tu9sY3 yfovp2x0PI1K6krLDycBRSmjDCeChiQ19xXYgAbQA9lly13c/gH0O7M3lSnTW57oC1rVz/uNo8W MkQWv6iV95l0nVeyiuMBFUy0jTpF/cJktTZ6qE7jZs3HUcS/scCq2rl3dzGQ1ZE+IEF3qRcG3V5 NrvMYnukT3PQaga/xMVArGfh0Mlya7dRxf2iamBGJuLqWuX7g5B//Ud53ZW7B7LgtoLK81c76wA pbQbmTD0sueVfRRamJT8kIhOa6FLuhls0Ue1sh0+XjeI9Ygkw8mVxJ0XoVydEMMprcbiest Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix to return a negative error code from the alloc_irq_index() error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun --- drivers/iommu/amd_iommu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 96de97a..71e94f3 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c @@ -3886,6 +3886,7 @@ static int irq_remapping_alloc(struct irq_domain *domain, unsigned int virq, } if (index < 0) { pr_warn("Failed to allocate IRTE\n"); + ret = index; goto out_free_parent; }