Received: by 10.223.185.116 with SMTP id b49csp1072154wrg; Fri, 23 Feb 2018 11:24:39 -0800 (PST) X-Google-Smtp-Source: AH8x22439zSPvDk7g5w3upaHaOSGm9AF4oDzd+ndX1ZGHC19H0eqTfFaA/eyFJlHNBgKfgxKQwdU X-Received: by 2002:a17:902:7883:: with SMTP id q3-v6mr2621294pll.361.1519413879073; Fri, 23 Feb 2018 11:24:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519413879; cv=none; d=google.com; s=arc-20160816; b=rTy+ZjDdHTpqAyI6+3MkGdMWsWVT6btyL/yy9pBBJ5/C/QUSObnM00wuJaAqCuhb4O R+N0yapQh5iUrsBGmokLtLBdmhdoMBJol9vkmBqV9jb8IMw4rZybX601OQGfPQrVeZ4P LK1F1WCWSnDeSBit1xMoAIjYBZmUHXxnnUK9Go17+YOHnGCxWbHnVG8KAuDfE0anCEjf lO4GcAH5LoI3r/FqnhldtaikWs9LGjXoOXM8hV1ZTrc2TyRFTVjHRwpmKr+Rf/NmbKdI 4LM5pUWUkT3FZf4J608HCRVZaPfd4owatcFK4gM8Ajrus9M3tH2aKZJnp6/NiIRFI6Ih y8jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=V3mBy1w2t9HJ8592rBMkjWjRwdU3LtTvyGgxo9GVRpQ=; b=mA5/Rou4R+IMLKAlwjaCNODhGdotydAEHj58fxYYy1Olc9K+7EOAkwB2NxufnIGlkt Gj1Y6+CLfUlp0FY2bFwpcTTzHD4GTluawaCqzxHitvnnag56AUFBQceg2Mib3eL1l7/f DlcffmXHH1T9v+S3cmLV0zL4zYXa1/RD3sAM/pZVmteGS4DSzeT38SVlN0DnrmL3C5Zh pYm7l7kpnKVlV+NozggHsJyUuOmMoGGhQlPBIwUuXwlakw+8U+1CLCBdnG9xJW9tplUR Jsf9nysCJgSBZPbkwhtPbDBFTbmmovCjk4FVJJQqQ2Y0naacEUa2Ws26m3feh9Dl/i63 Z98w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p9si2234573pff.235.2018.02.23.11.24.25; Fri, 23 Feb 2018 11:24:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754454AbeBWTXu (ORCPT + 99 others); Fri, 23 Feb 2018 14:23:50 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:47294 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935048AbeBWSxS (ORCPT ); Fri, 23 Feb 2018 13:53:18 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 8FF17FCE; Fri, 23 Feb 2018 18:53:17 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mustafa Ismail , Shiraz Saleem , Jason Gunthorpe , Sasha Levin Subject: [PATCH 4.14 090/159] i40iw: Do not free sqbuf when event is I40IW_TIMER_TYPE_CLOSE Date: Fri, 23 Feb 2018 19:26:38 +0100 Message-Id: <20180223170754.407848638@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180223170743.086611315@linuxfoundation.org> References: <20180223170743.086611315@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mustafa Ismail [ Upstream commit 10499986dbd8778e1acf9f9d2e166800dfee44b4 ] When the event type is I40IW_TIMER_TYPE_CLOSE, there is no sqbuf and it should not be freed as one in i40iw_schedule_cm_timer(). Fixes: f27b4746f378 ("i40iw: add connection management code") Signed-off-by: Mustafa Ismail Signed-off-by: Shiraz Saleem Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/hw/i40iw/i40iw_cm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/infiniband/hw/i40iw/i40iw_cm.c +++ b/drivers/infiniband/hw/i40iw/i40iw_cm.c @@ -1043,7 +1043,7 @@ negotiate_done: * i40iw_schedule_cm_timer * @@cm_node: connection's node * @sqbuf: buffer to send - * @type: if it es send ot close + * @type: if it is send or close * @send_retrans: if rexmits to be done * @close_when_complete: is cm_node to be removed * @@ -1067,7 +1067,8 @@ int i40iw_schedule_cm_timer(struct i40iw new_send = kzalloc(sizeof(*new_send), GFP_ATOMIC); if (!new_send) { - i40iw_free_sqbuf(vsi, (void *)sqbuf); + if (type != I40IW_TIMER_TYPE_CLOSE) + i40iw_free_sqbuf(vsi, (void *)sqbuf); return -ENOMEM; } new_send->retrycount = I40IW_DEFAULT_RETRYS; @@ -1082,7 +1083,6 @@ int i40iw_schedule_cm_timer(struct i40iw new_send->timetosend += (HZ / 10); if (cm_node->close_entry) { kfree(new_send); - i40iw_free_sqbuf(vsi, (void *)sqbuf); i40iw_pr_err("already close entry\n"); return -EINVAL; }