From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752374AbcIIHRK (ORCPT ); Fri, 9 Sep 2016 03:17:10 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:55503 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751386AbcIIHRJ (ORCPT ); Fri, 9 Sep 2016 03:17:09 -0400 From: Colin King To: Dennis Dalessandro , Doug Ledford , Sean Hefty , Hal Rosenstock , linux-rdma@vger.kernel.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH] IB/rdmavt: free the userspace memory region with kfree instead of vfree Date: Fri, 9 Sep 2016 08:15:37 +0100 Message-Id: <20160909071537.18821-1-colin.king@canonical.com> X-Mailer: git-send-email 2.9.3 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King The userspace memory region 'mr' is allocated with kzalloc in __rvt_alloc_mr however it is incorrectly being freed with vfree in __rvt_free_mr. Fix this by using kfree to free it. Signed-off-by: Colin Ian King --- drivers/infiniband/sw/rdmavt/mr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/sw/rdmavt/mr.c b/drivers/infiniband/sw/rdmavt/mr.c index 80c4b6b..46b6497 100644 --- a/drivers/infiniband/sw/rdmavt/mr.c +++ b/drivers/infiniband/sw/rdmavt/mr.c @@ -294,7 +294,7 @@ static void __rvt_free_mr(struct rvt_mr *mr) { rvt_deinit_mregion(&mr->mr); rvt_free_lkey(&mr->mr); - vfree(mr); + kfree(mr); } /** -- 2.9.3