Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4665183pxu; Tue, 13 Oct 2020 04:20:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZCLVgqnltqff3i4E42h43c3dsTM5MatanVLjVdTidLNnXqEox33SB1w084SB3tQtb2uvh X-Received: by 2002:a17:906:28db:: with SMTP id p27mr33617012ejd.424.1602588047356; Tue, 13 Oct 2020 04:20:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602588047; cv=none; d=google.com; s=arc-20160816; b=f05Ut9sNsEX6prx9XoYZHbLu3XRBIf/02Q7VMbX4q41YRsQ9sKF46VzyeO9/Mv0gSe tHmMui0uuy4SMauuuDJQHV43zqn+3cxsP83hgvTSwB9dNx5Rlo8EELgavV22nWE+RCPc Yjgbk7RNDGmuzORO0kdYweDNIs5LKAaUG12zcPSXapqYMPVTo8bnOz8F+1Vostjkd43B 0BSmSJnvlMWUzFTpw8EM0mYQs1QdMtRfO0pJlcH6FmtB20JdJxQqw6AAhvyhoVQz1/Jt wlHBAf1LGd6lnlm0cwIyrcMGIMELdxoxwp8ZEEQAC7OuL1EJOqQXqeOJQBIBsD9wtOf7 Fs4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=vpjyL/cWFsdQ/8javm2oHHWyECdb8PP/h6joVRZ6qzQ=; b=alwx/oeLZh3bF6sQFmBa0gvERPMroZVguo3kFHgm4gjLX3d/TV2oQvl8DtECRgrRUR ZlqhlhdcqkYCiv05ErulbUeOAFeiyMDVLpM3V+YU0JsWTnb3sCE91n9sDlXlJHQW3CKj sb9OnNMehaC6lz7C4qIZniZJqkxAZtMg3gwEM92XmSWPCWXNZI9B7EjPEBEX9wTTo4Hv gJUcc+gOzJgkcWOMPD9/DHqOczA7EIcj67nRMpUZpB8C0evOMQVzIKth5Hdy3bni5Ynq plG+K8++VpDKwuuSHW/f3EnRHe8tdIfG2WqCTH/QSXt17SZ07p43cTl2p03/bRt2SZ3h ttqg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g24si13864464ejw.434.2020.10.13.04.20.25; Tue, 13 Oct 2020 04:20:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728794AbgJMCi6 (ORCPT + 99 others); Mon, 12 Oct 2020 22:38:58 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:15206 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728130AbgJMCi6 (ORCPT ); Mon, 12 Oct 2020 22:38:58 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id C547B98CF3E395710DEF; Tue, 13 Oct 2020 10:38:56 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.487.0; Tue, 13 Oct 2020 10:38:46 +0800 From: Jing Xiangfeng To: , , , , , CC: , , Subject: [PATCH] thunderbolt: Add the missed ida_simple_remove() in ring_request_msix() Date: Tue, 13 Oct 2020 10:45:18 +0800 Message-ID: <20201013024518.195557-1-jingxiangfeng@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ring_request_msix() misses to call ida_simple_remove() in an error path. Add the missed function call to fix it. Fixes: 046bee1f9ab8 ("thunderbolt: Add MSI-X support") Signed-off-by: Jing Xiangfeng --- drivers/thunderbolt/nhi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/thunderbolt/nhi.c b/drivers/thunderbolt/nhi.c index 5f7489fa1327..7732e7a9942f 100644 --- a/drivers/thunderbolt/nhi.c +++ b/drivers/thunderbolt/nhi.c @@ -406,8 +406,10 @@ static int ring_request_msix(struct tb_ring *ring, bool no_suspend) ring->vector = ret; ring->irq = pci_irq_vector(ring->nhi->pdev, ring->vector); - if (ring->irq < 0) + if (ring->irq < 0) { + ida_simple_remove(&nhi->msix_ida, ret); return ring->irq; + } irqflags = no_suspend ? IRQF_NO_SUSPEND : 0; return request_irq(ring->irq, ring_msix, irqflags, "thunderbolt", ring); -- 2.17.1