Thread (16 messages) 16 messages, 3 authors, 2016-09-08

Re: [PATCH 4/9] hwrng: omap - Use the managed device resource API for registration

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: 2016-09-08 17:02:42

On Thu, Sep 08, 2016 at 05:47:13PM +0200, Romain Perier wrote:
I was wondering something. hwrng_unregister does not check the kref
reference counter of the object... so technically if the current
rng_device is in use, with or without devm... calling
platform->remove will break the driver anyway because
hwrng_unregister will unbind the device from /dev/hwrng. What I mean
is that I think that we had this issue even without
devm_hwrng_register.

Herbert, could you confirm ?
Right.  remove can happen at any time and the driver needs to
cope with it by returning an error from data_read if the hardware
disappears in the middle of an operation.

Cheers,
-- 
Email: Herbert Xu [off-list ref]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help