Received: by 10.223.185.116 with SMTP id b49csp2215581wrg; Thu, 15 Feb 2018 08:13:54 -0800 (PST) X-Google-Smtp-Source: AH8x224rctEDPT8UOXU+dPhPPeCYqCPJgURjLVapZTuV22DS4lkOyNF5N4xdnBKa5H17SzNjBwY4 X-Received: by 10.99.180.3 with SMTP id s3mr1210087pgf.148.1518711234574; Thu, 15 Feb 2018 08:13:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518711234; cv=none; d=google.com; s=arc-20160816; b=WpxoiTGaMyNkmiTNwJ3hDOZu/fmXqwtGryL6F6uYJaDav+oGTdpGmmnP8WzNejG6Xs S8+C6nCsybKOZajDkXlRqoQBjZeQlRlUsFNWLR/XcunHjwpBiFygVSn7LPPqDSBh2Euz PuAN4p7AuCNEcBF/x+uI9MN7MriGyaUV6dW/4iPBMNPia0Jh+zZWRWB886mEM9Bt885A iocB39q2MWbZVvVtTu5elrLVI48UlkFFJWDfuUf4gsGHVN4B80w5GW9rf4uHL82mHlfO AVX/gTKENTyCcxdCZQ9vF/oX1WslMdd4almyX7sujSh5koMAmDBzkYsVeIaM8CIxOZXl PdSA== 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=VKt0Er5L2thT4qN2bIuEG2RxthSbZeNsydfKYNed9VI=; b=dJLF17XH9olD54x/SIDXvpIZAEHRtZCeZDWsI8XuB8ewQkRaEWgt7VqgvXRFEIKlcn 8VRJecVaTIZ8bkeVOoM9RZTyuIGd1DSBEfMy6h0U0VZtfARUUkD/SdZEZJx8AIGfQepK BHAsG9Opqrh/brEEx6Zq/yagoacXbLHHU4un3wwV32YpPHUGQKXc6fnaLY6D0rotxEa9 MGDu6he4uMwGukkumn9p6lslwnF4gHx0/z9pmeF+uoHXEmuFxx9rrmwPkXUlyU5xK2jT FneRvjyqrWOvszOlttVcuFxhW+TUM+rX5+/FcqswFNeLoL1J9UCI/WkeZvqajTOsAmEO iAEg== 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 x9-v6si3332810plw.160.2018.02.15.08.13.40; Thu, 15 Feb 2018 08:13:54 -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 S1424404AbeBOPpK (ORCPT + 99 others); Thu, 15 Feb 2018 10:45:10 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:34822 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1424368AbeBOPpF (ORCPT ); Thu, 15 Feb 2018 10:45:05 -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 290B711B3; Thu, 15 Feb 2018 15:45:04 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Howells Subject: [PATCH 4.15 142/202] afs: Add missing afs_put_cell() Date: Thu, 15 Feb 2018 16:17:22 +0100 Message-Id: <20180215151720.494934181@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215151712.768794354@linuxfoundation.org> References: <20180215151712.768794354@linuxfoundation.org> User-Agent: quilt/0.65 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.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: David Howells commit e44150157f42219fa5c074588efdb31ccfb197fc upstream. afs_alloc_volume() needs to release the cell ref it obtained in the case of an error. Fix this by adding an afs_put_cell() call into the error path. This can triggered when a lookup for a cell in a dynamic root or an autocell mount returns an error whilst trying to look up the server (such as ENOMEDIUM). This results in an assertion failure oops when the module is unloaded due to outstanding refs on a cell record. Fixes: d2ddc776a458 ("afs: Overhaul volume and server record caching and fileserver rotation") Signed-off-by: David Howells Signed-off-by: Greg Kroah-Hartman --- fs/afs/volume.c | 1 + 1 file changed, 1 insertion(+) --- a/fs/afs/volume.c +++ b/fs/afs/volume.c @@ -102,6 +102,7 @@ static struct afs_volume *afs_alloc_volu error_2: afs_put_serverlist(params->net, slist); error_1: + afs_put_cell(params->net, volume->cell); kfree(volume); error_0: return ERR_PTR(ret);