From patchwork Thu May 9 10:03:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Reinecke X-Patchwork-Id: 10936965 X-Patchwork-Delegate: jgg@ziepe.ca 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 07C2D14DB for ; Thu, 9 May 2019 10:04:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB33A28306 for ; Thu, 9 May 2019 10:04:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF45628581; Thu, 9 May 2019 10:04:07 +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 7216828306 for ; Thu, 9 May 2019 10:04:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725892AbfEIKEG (ORCPT ); Thu, 9 May 2019 06:04:06 -0400 Received: from mx2.suse.de ([195.135.220.15]:43382 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725826AbfEIKEG (ORCPT ); Thu, 9 May 2019 06:04:06 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 031C9AB87; Thu, 9 May 2019 10:04:05 +0000 (UTC) From: Hannes Reinecke To: Doug Ledford Cc: Jason Gunthorpe , linux-rdma@vger.kernel.org, Hannes Reinecke , Hannes Reinecke Subject: [PATCH] infiniband/core: zero out bind_list pointer in cma_release_port() Date: Thu, 9 May 2019 12:03:58 +0200 Message-Id: <20190509100358.114974-1-hare@suse.de> X-Mailer: git-send-email 2.16.4 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 After calling kfree() on the bind_list we should be zeroing out the pointer, otherwise a second call to cma_release_port() will crash. Signed-off-by: Hannes Reinecke --- drivers/infiniband/core/cma.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c index 68c997be2429..2a0010eddb33 100644 --- a/drivers/infiniband/core/cma.c +++ b/drivers/infiniband/core/cma.c @@ -1770,6 +1770,7 @@ static void cma_release_port(struct rdma_id_private *id_priv) if (hlist_empty(&bind_list->owners)) { cma_ps_remove(net, bind_list->ps, bind_list->port); kfree(bind_list); + id_priv->bind_list = NULL; } mutex_unlock(&lock); }