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]
Date:	Tue, 11 Dec 2012 10:35:15 +0000
From:	Alan Cox <alan@...rguk.ukuu.org.uk>
To:	Alexander Holler <holler@...oftware.de>
Cc:	Lars-Peter Clausen <lars@...afoo.de>, linux-kernel@...r.kernel.org,
	linux-iio@...r.kernel.org, Jonathan Cameron <jic23@....ac.uk>,
	rtc-linux@...glegroups.com,
	Alessandro Zummo <a.zummo@...ertech.it>,
	srinivas pandruvada <srinivas.pandruvada@...el.com>
Subject: Re: [PATCH 3/3 v2] iio: add rtc-driver for HID sensors of type time

On Tue, 11 Dec 2012 01:01:29 +0100
Alexander Holler <holler@...oftware.de> wrote:

> Am 10.12.2012 23:36, schrieb Lars-Peter Clausen:
> > Well, I've been exaggerating a bit, you can call it multiple times, but you
> 
> Thanks a lot for the explanation(s).
> 
> >>>> +error_free_drvdata:
> >>>> +    platform_set_drvdata(pdev, NULL);
> >>>
> >>> Setting the platform data to NULL should not be necessary. Some
> >>> drivers do
> >>> this but it's kind of the result of cargo-cult-coding.
> >>>
> >>>> +    kfree(time_state);
> 
> Btw. I wouldn't call that cargo-cult-coding. It's more defensive 
> programming as people might not be sure, if there is something around 
> which still might access the platform data at that point. Ok, there 
> would be a need for a mutex or similiar if that really could happen, but 
> I wouldn't call such practices cargo-cult. ;)

Agreed - pointer NULLing catches a lot of mistakes during teardown where
timers or interrupts running in parallel get missed.

Alan
--
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