Received: by 2002:aa6:c429:0:b029:98:93ff:f56f with SMTP id g9csp3394033lkq; Mon, 23 Nov 2020 04:42:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJwmRCL9YipzxwsLLwNcfhqAAPfuaoPgYdzviSX1Ws+YCedzuxtdx4tmSeSqlxMXwbhHqzHU X-Received: by 2002:aa7:cb58:: with SMTP id w24mr46753296edt.35.1606135357548; Mon, 23 Nov 2020 04:42:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606135357; cv=none; d=google.com; s=arc-20160816; b=O/CHBcLjdFTOPkAg+tgzMAImoP7Uda3KQAMebMEe0wYGgdmOBqccLeFqJLiBaQYJn/ oJGy4TILu6vPy6g/cLSaePNv1Skd3naeF+xNNCQe/h/mO1OsH0gJzX3N24JLQGkKu63l Z9rov/6scIm/d+EkUHvWEfRA9jDS2NOkNVE0jKoX9gWM6daUIF82rZw3KoMiYBMu760m n8wyQdcYZ3ihNm54Zl5Sgb93joyUD9KWxdXXWXbh/ErqUp7aoytqTZj8XP0JsxUC/zHf ovI7f78z0XV868I/4b1nhb5JKaTE3uAmOif4XgN/zszWFQ6+/Ypx6G/0NOpdxEm5sfWJ petQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rZuuvfY2UzvoxNmiHxIlEKSRzZouMj7FXYQSQxJJDq8=; b=asVGbjwz1tYqTZGuFXQZJZ9VdK0kuQ3lJ/0Rpa9OyPi/MNnaYHT9z9NWX1cJZsmtX3 wZhZZCfseSmh2GX/vc6jyFujwdGWAuwOXn9YIqkgViSpPmXPk2FoBasROd24gYrRWm7d OoAtvOs78yO2vr8PETltfCrhsX1p0NbO22fPExyYg/+/NjGmmc6wWNY6quv8RObZCKXp 7YHX4yLJx9T8qgy2eugUIu2+FlPdaz+yBDBSXJ56ySmMUQSyqqTMaHC96EGiZPzeORBo qbBb7zA0Jn7B0ZwHaHGfFCPU3h5fEFz3joEOOMKIhipyzTE5Iz9nzfiCRjrwPrB/770m T+Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lxF3zsus; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hb20si6732127ejc.664.2020.11.23.04.42.13; Mon, 23 Nov 2020 04:42:37 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lxF3zsus; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731851AbgKWMhA (ORCPT + 99 others); Mon, 23 Nov 2020 07:37:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:48916 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731763AbgKWMgn (ORCPT ); Mon, 23 Nov 2020 07:36:43 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D945C20721; Mon, 23 Nov 2020 12:36:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606135003; bh=hexWN8t9OWoJF/djr6mOixR9wKRlPWg6Mhv5UdRqB5U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lxF3zsusHMUphRapbLbUxEoIE08SLka+IgBsYDP9s6XIKuwVAnr+UtoqMLeqRmDzo UGObRsvzFDkCPb7wRNiXLOY1fv6gsd8HCZJs7xXHig96p3iHfwVB+fzbh2sZCOiYse i1pUijsXcw0itNuoteHftDhTZp0eJOG5/FMu4jz0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Qinglang Miao , Jason Gunthorpe , Sasha Levin Subject: [PATCH 5.4 070/158] RDMA/pvrdma: Fix missing kfree() in pvrdma_register_device() Date: Mon, 23 Nov 2020 13:21:38 +0100 Message-Id: <20201123121823.314453894@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121819.943135899@linuxfoundation.org> References: <20201123121819.943135899@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Qinglang Miao [ Upstream commit d035c3f6cdb8e5d5a17adcbb79d7453417a6077d ] Fix missing kfree in pvrdma_register_device() when failure from ib_device_set_netdev(). Fixes: 4b38da75e089 ("RDMA/drivers: Convert easy drivers to use ib_device_set_netdev()") Link: https://lore.kernel.org/r/20201111032202.17925-1-miaoqinglang@huawei.com Reported-by: Hulk Robot Signed-off-by: Qinglang Miao Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- 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 780fd2dfc07eb..10e67283b9db7 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_srq_free; spin_lock_init(&dev->srq_tbl_lock); rdma_set_device_sysfs_group(&dev->ib_dev, &pvrdma_attr_group); -- 2.27.0