lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20090828.232429.106266868.anemo@mba.ocn.ne.jp>
Date:	Fri, 28 Aug 2009 23:24:29 +0900 (JST)
From:	Atsushi Nemoto <anemo@....ocn.ne.jp>
To:	wim@...ana.be
Cc:	roel.kluin@...il.com, akpm@...ux-foundation.org,
	linux-kernel@...r.kernel.org, teheo@...e.de
Subject: Re: [PATCH] txx9wdt.c:52: Fix txx9wdt_probe() cleaning up after
 errors

On Thu, 27 Aug 2009 22:13:17 +0200, Wim Van Sebroeck <wim@...ana.be> wrote:
> > > Make txx9wdt_probe() clean up after errors.
> > > 
> > > Signed-off-by: Roel Kluin <roel.kluin@...il.com>
> > > ---
> > > Any comments?
> > 
> > Well, why is this patch needed?  I intentionally omitted iounmap and
> > release_mem_region because devres guarantee these resources are freed
> > on probe failure.  Or are there any leaks?
> 
> My opinion: a driver should do proper clean-up on probe failures because
> 1) this makes clean and robust code and shows that you know what you are doing
> 2) to avoid having to search for leaks if there are any. See the NULL pointer story...

I think "proper clean-up" in this case is "do nothing for
devres-managed resources".  An example in
Documentation/driver-model/devres.txt clearly say so.  Actually most
drivers do not call devm_iounmap in any case.

Also, the patch added devm_iounmap in failure path but not in exit
path.  This looks inconsistent.

---
Atsushi Nemoto
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ