Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp47369pxb; Tue, 10 Nov 2020 19:21:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJw4Ilq6kD59pBrpm0f/q6snbJUg9EglAQD2AsEwUsfTe/Iyvd82aHyXlCaPkblN2TmUSNRG X-Received: by 2002:aa7:dc52:: with SMTP id g18mr2785169edu.369.1605064916474; Tue, 10 Nov 2020 19:21:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605064916; cv=none; d=google.com; s=arc-20160816; b=V/lEEmWpsJKEJBBO8YL6VZbn+3ReHXoBVEk6B6KQkwnmSWrb/gv1LWk5WArSmjVV4h swGqJM9NZntmR54afnPStIThlvD/2z8lf9ic+LltXeFjdUusuD3Nt5NmHNy4xRH4awdM DYzLnBEwxQop8BGvJilMX53r+VQUpbasXQvOUelWb2U797TNlg3DH8YrxqEkpEKqkPu7 6w65iN1fEIln7RSUnhhlIlSVzTECH82nxwyRxuLIMhLfcNUtQ6FBtjTzKTKiRI0dCS4D kLt2pOSv1AUWrCYUqR/g06SP9se4ZRP0VB6efadyqr03VXBy6YoxZzXQvX5FL8l6+nwt PIbA== 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=G6LhieNqQgfnvYlGVQ4Ch/hsFQ+AQqYLRj3pZ7Dtgm4=; b=EQsmW5pzcbB87qYZBtyMjhABi9q6T8QLBn7uDlUvJDNsXeTjBa3g5w/2ixy6v9cknZ 6x+MK68uhKynIrjDN+WXVT/DGhESgkTrxhqW0ZmoszHZnKo3iCtxnPMdelvHG7uhDvl3 coToaxsbCD5qYB0b1Dw7sdBeyrMJsd9zg+5/0CJ9Tdrb12dAfGWZhH/S+UbrRo6b7+q+ 5ILpEW7GPmmGjimqssf1+4lch9lRK+bJrk5LDlurkUTx9mpF/gRm8TI0FEsbctJAEH/L zIRshEwt9clqB0gKKaghkZvzHHEvRbgzTFz0fPvOorRDF/z+9X5UTmTXdUFCmnZUQODm B/Bw== 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 h10si435115ejk.12.2020.11.10.19.21.33; Tue, 10 Nov 2020 19:21:56 -0800 (PST) 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 S1726216AbgKKDRL (ORCPT + 99 others); Tue, 10 Nov 2020 22:17:11 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:7169 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726251AbgKKDRG (ORCPT ); Tue, 10 Nov 2020 22:17:06 -0500 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4CW8zB1wS6z15TsS; Wed, 11 Nov 2020 11:16:54 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.487.0; Wed, 11 Nov 2020 11:16:52 +0800 From: Qinglang Miao To: Adit Ranadive , VMware PV-Drivers , Doug Ledford , Jason Gunthorpe CC: , , "Qinglang Miao" Subject: [PATCH] RDMA/pvrdma: fix missing kfree in pvrdma_register_device Date: Wed, 11 Nov 2020 11:22:02 +0800 Message-ID: <20201111032202.17925-1-miaoqinglang@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 Fix missing kfree in pvrdma_register_device() when fails to do ib_device_set_netdev. Fixes: 4b38da75e089 ("RDMA/drivers: Convert easy drivers to use ib_device_set_netdev()") Reported-by: Hulk Robot Signed-off-by: Qinglang Miao --- drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c index fa2a3fa0c3e4..f71d99946bed 100644 --- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c +++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c @@ -266,7 +266,7 @@ static int pvrdma_register_device(struct pvrdma_dev *dev) } ret = ib_device_set_netdev(&dev->ib_dev, dev->netdev, 1); if (ret) - return ret; + goto err_qp_free; spin_lock_init(&dev->srq_tbl_lock); rdma_set_device_sysfs_group(&dev->ib_dev, &pvrdma_attr_group); -- 2.23.0