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: <AANLkTim9XhrHjQy8EmGAez6DV8e-aASDHUQOyf=cjvdM@mail.gmail.com>
Date:	Mon, 14 Mar 2011 09:29:00 -0500
From:	Bill Gatliff <bgat@...lgatliff.com>
To:	linux-kernel@...r.kernel.org, linux-embedded@...r.kernel.org
Cc:	Bill Gatliff <bgat@...lgatliff.com>
Subject: Re: [PWM v8 1/3] PWM: Implement a generic PWM framework

Guys:

On Sat, Mar 12, 2011 at 10:24 PM, Bill Gatliff <bgat@...lgatliff.com> wrote:
> +static ssize_t pwm_duty_ns_show(struct device *dev,
> +                               struct device_attribute *attr,
> +                               char *buf)
> +{
> +       struct pwm_device *p = to_pwm_device(dev);
> +       return sprintf(buf, "%lu\n", pwm_get_duty_ns(p));
> +}


What would happen if device_unregister() was called on the above
device while duty_ns_show() was running?

My hope is that the device_unregister() would decrement the usage
count on the device, but the count would still be nonzero due to the
running attribute method; thus, the device would not be deleted.  When
the method exited, the usage count would become zero and THEN the
device would disappear.  Is that how things work?  (I have looked at
the code for device_unregister() and friends, but haven't yet been
able to answer this question for myself; said code seems nontrivial).


b.g.
-- 
Bill Gatliff
bgat@...lgatliff.com
--
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