Received: by 10.223.185.116 with SMTP id b49csp3121894wrg; Mon, 5 Mar 2018 14:38:52 -0800 (PST) X-Google-Smtp-Source: AG47ELtM9Rxlmei9ru4gj9jlgTG/ltyOFp2Nqwr5YEx9M51UC1D+qvOrrDuFjZf9DWNTGfM7WztG X-Received: by 10.99.189.82 with SMTP id d18mr13458724pgp.172.1520289532387; Mon, 05 Mar 2018 14:38:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520289532; cv=none; d=google.com; s=arc-20160816; b=r9Qqbn0CIRzbQiEMYYY1RClXBfDIaVrYeBTmFzoPF29QAV46gLkiaYx8NAJvAkNZlY h7H5JtXNxDpg6odJ7I0jAYaEx5kjkgQWjGsFRWqjXhAjIpUzWoYASx2AzmzM8Kl+de2g /zd2J8GTDNgYrPNmF4ofsDMchSUyY8vJsY+aGdVVhqA9Hsf/Tn45MtE3LDtEOIx1uQ6c dD3Hl/xPY7WwurxwXLQ0Y0kRrB3x3r3Vvsob4YEjcpOWkDswaS4PmjEsnLS3SuruVKyW 1Gdl4/HAlhaujwpinnzTPM9cY8B+Bh6fbcbFlsNlLjx5/JeWoG33XqJYBY4ppF0s96yH trsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dmarc-filter:arc-authentication-results; bh=unK2TnDh6lGHjcDQ4a17Z0aEe5u3PJtVAEIQyI1oqY0=; b=C/ba4UBl8ef+hz/gCKjSTAxUFUtgOuiFwuYGmHEioGa1JYEZFf995nrUC4L57a8k66 zGZ45cOcV2zHCaMbfk+HTX9YSltWWsPKdexLsihV1pRvnS206xPM0OwZo2t6z6P99zYU x26hqFSXBXSm9/uBGiHID1zUAoG8wEESOzDhFQTIZxqM8QxSKKNZCwZfQhvKpxUK1Mc4 LQZNTkSk4RnCcOhGnaLEHo8d6aI+aE5jLPvXdFZ+KWPEcMuFNuRu7iIgrBBVPeEktCfP WJFvDjuDXl3mu/1bM7EzOHuJgPrq94zIXTDzuG0sWD8LHnxsaSFPj7p/UXMYj6p8R2af a6pQ== 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 h10-v6si9994382plk.706.2018.03.05.14.38.37; Mon, 05 Mar 2018 14:38:52 -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 S1753053AbeCEWhm (ORCPT + 99 others); Mon, 5 Mar 2018 17:37:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:34996 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752508AbeCEWhl (ORCPT ); Mon, 5 Mar 2018 17:37:41 -0500 Received: from saruman (jahogan.plus.com [212.159.75.221]) (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 DD0E920685; Mon, 5 Mar 2018 22:37:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DD0E920685 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=jhogan@kernel.org Date: Mon, 5 Mar 2018 22:37:36 +0000 From: James Hogan To: Vasyl Gomonovych Cc: ralf@linux-mips.org, paul.gortmaker@windriver.com, linux-mips@linux-mips.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] MIPS: TXx9: Add missing iounmap Message-ID: <20180305221833.GJ4197@saruman> References: <1511473795-20137-1-git-send-email-gomonovych@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="M9kwpIYUMbI/2cCx" Content-Disposition: inline In-Reply-To: <1511473795-20137-1-git-send-email-gomonovych@gmail.com> User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --M9kwpIYUMbI/2cCx Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 23, 2017 at 10:49:55PM +0100, Vasyl Gomonovych wrote: > Add the missing iounmap() before put_device and > return from txx9_sramc_init(). >=20 > Signed-off-by: Vasyl Gomonovych > --- > arch/mips/txx9/generic/setup.c | 2 ++ > 1 file changed, 2 insertions(+) >=20 > diff --git a/arch/mips/txx9/generic/setup.c b/arch/mips/txx9/generic/setu= p.c > index 1791a44ee570..6ef5edb85d68 100644 > --- a/arch/mips/txx9/generic/setup.c > +++ b/arch/mips/txx9/generic/setup.c > @@ -965,6 +965,8 @@ void __init txx9_sramc_init(struct resource *r) > } > return; > exit_put: > + if (dev->base) > + iounmap(dev->base); I think if dev->base was NULL then a different error path would have been taken already. More concerning to be honest though is the sysfs_create_bin_file() error handling just above here, which seems to iounmap() and kfree() *after* device_unregister(). txx9_device_release() already kfrees it. The iounmap() call should prresumably move before the kfree() in txx9_device_release(), and the kfree() after device_unregister() should be removed? Cheers James > put_device(&dev->dev); > return; > } > --=20 > 1.9.1 >=20 --M9kwpIYUMbI/2cCx Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEd80NauSabkiESfLYbAtpk944dnoFAlqdxq4ACgkQbAtpk944 dnqrgA//c5yKC1sXPNhPfR2Am6vC3Lh/V2KaV8LEgTZlYNMCVUOeTJYtbV7yVlVY oY4PsX3lXgzWDHUg+zOr6YNHb4bOOhQ/Fo5Tbep0aybviosbEyx4kgBGIAWnPxuj 1UDNWNcMFYLtCWsIrbziXCKXeOgjJ4zCxb3d3c7a7YXs1HIfRkH2TZV8E6AjnVkI x0bV/3pF6G+jjtGMn1b5UOgXQLn6/rzYSWDBnXan4xZUpLEXHN9PF/C6zU6ibOFz egdEigrt1seXx6meLlDpeph0vLhVhNsBekON7FskLq6+8vPxfZlCIkl5y2aSBWnS zI8Y5Lx0Z0Mx7yg8o4HRWQZVYKjfzjw11Ax0OjGqPGaHsDckDUUVFcycj5naUipu j2laZjTljAULGZ2pFOEKG4dyGfCIpPZV6wUNZSnZ7rC1J2/eTEMu8dRshGHYtXY6 Gj7JuWu61LrQjeDTqjuCVU3ckqqpFUL66qd1I3usqlZJ5m6EjA0r99Wx34rLt+OX Kskf4FNhMtDqneb39s6g/pBA8WCTXb/pAg1/C0uEKjzyBfXfxgt2JrAPgFtqehuc OnlhSkw3PKqauN4FpmOBfHlRBn43ysqiceupNcCAIx0/7e8lAFr0z7eFDSc8PWxz qixmiwfsXsMuG8xL+AUwqPahT+zxm2V9p8v+1LJ95W+3yeIaoek= =Z91+ -----END PGP SIGNATURE----- --M9kwpIYUMbI/2cCx--