Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp5854919ybn; Sun, 29 Sep 2019 07:08:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqyHGAqLm6wmYYx0DxTb856lAVHrpcExfuRFaBk5isKfylXNiJ+w47VTdQs6zLyO8AnU8Btj X-Received: by 2002:a50:d808:: with SMTP id o8mr14769687edj.74.1569766096817; Sun, 29 Sep 2019 07:08:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569766096; cv=none; d=google.com; s=arc-20160816; b=SIUJgEoyuzgMHjElU23RkeiznWuKJh4pQNcZZqJayMAq5tPEtaxVnNIavF5w1BeOqo ArWEFPLxezdDGrk0sftXBua90+eTEQKgRbjHvuRMNM1cPSJXT/PWwg2WZgwPOIIg+w0L X11dJCv2YuKZLofSMZstEY6mwFXxD+yy2bZycz4z9C2IqnycInvSp82vbdGADdj4Nw48 9FlCCdHWLtUL/hFyyCp8pjhqN9MT9eYkMiVENjfY5IOK+hFhLIjQPJQjGd6qToWrvh47 OzRCYyrfW1uobVCTkXloLXR9JNukYG7LILphc87kon9Sx0hGRcE3yygMvB4Q2SytOw18 b0QQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nJiYvH/0nzi8CQJ4njLFoz+mRvFid8PjV30OCERtd8U=; b=StzfzmKXwPEO5diU9PgGnEln7zyCpRzmOExhMbRxYlE9xkfZbT26dx0qjDhR/JO1VF /4pMxb1fY80R0ooSBuMpsgm1CDXZbHzic+vQDxc5puuul/m1gIGEf1E7eomXcPRn7TFp Z67s1XMkoM93VF4wG4sOBoMJduBz0c8Dy8iwRZIYKbl1rAzNov4WO6kEluEV7d+9Isk7 XyA3AqPLSi+VfaKUvoQwhlV9GdxvEiJ6X2+MppcQGWJxjLC5HMmbSb1kCcID4f58JesH HB2UQShXCEEkqdDmBWMxkvQ/9KzwygJsf5T99BzwOOFCits79yC/Z/BWT+AfjOa6TX6b 6uEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cjV7ldql; 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 pj21si5361666ejb.64.2019.09.29.07.07.52; Sun, 29 Sep 2019 07:08:16 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=cjV7ldql; 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 S1729166AbfI2OAx (ORCPT + 99 others); Sun, 29 Sep 2019 10:00:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:42850 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729310AbfI2OAv (ORCPT ); Sun, 29 Sep 2019 10:00:51 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 1780121882; Sun, 29 Sep 2019 14:00:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569765650; bh=HmPW9PA3lINIaJ32HPlnVu0zN2UyoH5PCAx7CY3Qooo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cjV7ldqlZUIkSFHh8fjcUx3DbzcnMncFXc4phRYdhkM/pEvGqwT/FwLageELlG4BJ HltF0NDmyrl8rAh5ork9VVf1Znl4SmOCeZtyiUgYd56U3wlMOuKhP+x3+7DUfEZXR/ eljx/wYj9EgrFNa2Ze4ftf2mP3D230Lpyw8LHYNI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Juliet Kim , "David S. Miller" , Sasha Levin Subject: [PATCH 5.2 05/45] net/ibmvnic: free reset work of removed device from queue Date: Sun, 29 Sep 2019 15:55:33 +0200 Message-Id: <20190929135026.278403849@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190929135024.387033930@linuxfoundation.org> References: <20190929135024.387033930@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Juliet Kim [ Upstream commit 1c2977c094998de032fee6e898c88b4a05483d08 ] Commit 36f1031c51a2 ("ibmvnic: Do not process reset during or after device removal") made the change to exit reset if the driver has been removed, but does not free reset work items of the adapter from queue. Ensure all reset work items are freed when breaking out of the loop early. Fixes: 36f1031c51a2 ("ibmnvic: Do not process reset during or after device removal”) Signed-off-by: Juliet Kim Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/ibm/ibmvnic.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index fa4bb940665c2..6644cabc8e756 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c @@ -1985,7 +1985,10 @@ static void __ibmvnic_reset(struct work_struct *work) while (rwi) { if (adapter->state == VNIC_REMOVING || adapter->state == VNIC_REMOVED) - goto out; + kfree(rwi); + rc = EBUSY; + break; + } if (adapter->force_reset_recovery) { adapter->force_reset_recovery = false; @@ -2011,7 +2014,7 @@ static void __ibmvnic_reset(struct work_struct *work) netdev_dbg(adapter->netdev, "Reset failed\n"); free_all_rwi(adapter); } -out: + adapter->resetting = false; if (we_lock_rtnl) rtnl_unlock(); -- 2.20.1