From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E547C433EF for ; Wed, 22 Sep 2021 09:06:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0780E60F6B for ; Wed, 22 Sep 2021 09:06:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234247AbhIVJIE (ORCPT ); Wed, 22 Sep 2021 05:08:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:41284 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234059AbhIVJH7 (ORCPT ); Wed, 22 Sep 2021 05:07:59 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A91846137B; Wed, 22 Sep 2021 09:06:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632301590; bh=PmoI3qb9RefaDlrfo61jjLqF6GxCoCfoWkUsp5WGMUI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=x5Cl62H0bQTXibTROB6I8UFjNfjrUsvDa24fheVuClvVLZ+kdUAH64ZbG7s0bjn9J C/HyyF5wpLG0T7oBHENBxJsoVO/jKKo82Ywwq0uaHGfRNvUeL0QFEyIgcJn1TSdFc7 NmjLj3832SdblbUIszCzB4aIQ/FvxCB/ki5czlK4= Date: Wed, 22 Sep 2021 11:06:27 +0200 From: Greg Kroah-Hartman To: Pavel Machek Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Christophe JAILLET , Bartosz Golaszewski , Sasha Levin Subject: Re: [PATCH 5.10 100/122] gpio: mpc8xxx: Fix a potential double iounmap call in mpc8xxx_probe() Message-ID: References: <20210920163915.757887582@linuxfoundation.org> <20210920163919.067590477@linuxfoundation.org> <20210921212526.GA28467@duo.ucw.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 22, 2021 at 11:05:19AM +0200, Greg Kroah-Hartman wrote: > On Tue, Sep 21, 2021 at 11:25:26PM +0200, Pavel Machek wrote: > > Hi! > > > > > [ Upstream commit 7d6588931ccd4c09e70a08175cf2e0cf7fc3b869 ] > > > > > > Commit 76c47d1449fc ("gpio: mpc8xxx: Add ACPI support") has switched to a > > > managed version when dealing with 'mpc8xxx_gc->regs'. So the corresponding > > > 'iounmap()' call in the error handling path and in the remove should be > > > removed to avoid a double unmap. > > > > This is wrong, AFAICT. 5.10 does not have 76c47d1449fc ("gpio: > > mpc8xxx: Add ACPI support") so iounmap is still neccessary and this > > adds a memory leak. > > Ah, but then I have to drop 889a1b3f35db ("gpio: mpc8xxx: Use > 'devm_gpiochip_add_data()' to simplify the code and avoid a leak") from > the 5.10 queue as it depends on this one. > > Can you provide a working backport of that commit so that I can queue up > the fix? Oh nevermind, I fixed it up myself. greg k-h