From patchwork Fri Dec 21 02:19:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yue Haibing X-Patchwork-Id: 10739827 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4F50B14E5 for ; Fri, 21 Dec 2018 02:20:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 30DDB288D1 for ; Fri, 21 Dec 2018 02:20:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E9C4288DD; Fri, 21 Dec 2018 02:20:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4609E288D1 for ; Fri, 21 Dec 2018 02:20:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387895AbeLUCT7 (ORCPT ); Thu, 20 Dec 2018 21:19:59 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:43865 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732301AbeLUCT7 (ORCPT ); Thu, 20 Dec 2018 21:19:59 -0500 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 3E4EEBBAC63C5; Fri, 21 Dec 2018 10:19:56 +0800 (CST) Received: from localhost (10.177.31.96) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.408.0; Fri, 21 Dec 2018 10:19:46 +0800 From: YueHaibing To: , , , CC: , , YueHaibing Subject: [PATCH -next] IB/qib: Add missing err handle for qib_user_sdma_rb_insert Date: Fri, 21 Dec 2018 10:19:38 +0800 Message-ID: <20181221021938.13784-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.177.31.96] X-CFilter-Loop: Reflected Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It should goto err handle if qib_user_sdma_rb_insert fails, other than success return. Fixes: 67810e8c3c01 ("RDMA/qib: Remove all occurrences of BUG_ON()") Signed-off-by: YueHaibing Acked-by: Mike Marciniszyn --- drivers/infiniband/hw/qib/qib_user_sdma.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/infiniband/hw/qib/qib_user_sdma.c b/drivers/infiniband/hw/qib/qib_user_sdma.c index 31c523b..e87c0a7 100644 --- a/drivers/infiniband/hw/qib/qib_user_sdma.c +++ b/drivers/infiniband/hw/qib/qib_user_sdma.c @@ -237,6 +237,8 @@ qib_user_sdma_queue_create(struct device *dev, int unit, int ctxt, int sctxt) ret = qib_user_sdma_rb_insert(&qib_user_sdma_rb_root, sdma_rb_node); + if (ret == 0) + goto err_rb; } pq->sdma_rb_node = sdma_rb_node;