mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
[PATCH] inotify/idr leak fix
Fix a bug which was reported and diagnosed by Stefan Jones <[email protected]> IDR trees include a cache of idr_layer objects. There's no way to destroy this cache, so when we discard an overall idr tree we end up leaking some memory. Add and use idr_destroy() for this. v9fs and infiniband also need to use idr_destroy() to avoid leaks. Or, we make the cache global, like radix_tree_preload(). Which is probably better. Later. Cc: Eric Van Hensbergen <[email protected]> Cc: Roland Dreier <[email protected]> Cc: Robert Love <[email protected]> Cc: John McCutchan <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
c0fef676bb
commit
8d3b35914a
3 changed files with 15 additions and 0 deletions
|
|
@ -176,6 +176,7 @@ static inline void put_inotify_dev(struct inotify_device *dev)
|
|||
if (atomic_dec_and_test(&dev->count)) {
|
||||
atomic_dec(&dev->user->inotify_devs);
|
||||
free_uid(dev->user);
|
||||
idr_destroy(&dev->idr);
|
||||
kfree(dev);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue