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] [day] [month] [year] [list]
Date:	Thu, 8 Nov 2012 14:13:46 +0800
From:	Wei Yongjun <weiyj.lk@...il.com>
To:	akpm@...ux-foundation.org
Cc:	a.zummo@...ertech.it, yongjun_wei@...ndmicro.com.cn,
	rtc-linux@...glegroups.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] rtc: avoid calling platform_device_put() twice in test_init()

On 11/07/2012 08:51 AM, Andrew Morton wrote:
> On Tue, 23 Oct 2012 13:08:41 +0800
> Wei Yongjun <weiyj.lk@...il.com> wrote:
>
>> From: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>
>>
>> In case of error, the function test_init() need to call
>> platform_device_del() instead of platform_device_unregister().
>> Otherwise, we may call platform_device_put() twice.
>>
> Is platform_device_del() the partner to platform_device_add()?  If so
> then yes, this looks right.  But I think the labels can be improved:
>
> _
>
>
> However, take a look at test_exit().  it does
> platform_device_unregister(test0) when test0 is in the same state.  Is
> that code wrong as well?  Presumably it's working OK?

platform_device_unregister() is a warp of platform_device_del()
and platform_device_put(), if platform_device_add() success, we
can use platform_device_unregister() to do this, so that code
is OK.
 


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