mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
xenbus/backend: Protect xenbus callback with lock
[ Upstream commit 060eabe8fbe726aca341b518366da4d79e338100 ] A driver's 'reclaim_memory' callback can race with 'probe' or 'remove' because it will be called whenever memory pressure is detected. To avoid such race, this commit embeds a spinlock in each 'xenbus_device' and make 'xenbus' to hold the lock while the corresponded callbacks are running. Reviewed-by: Juergen Gross <[email protected]> Signed-off-by: SeongJae Park <[email protected]> Signed-off-by: Boris Ostrovsky <[email protected]> Stable-dep-of: afc545da381b ("xen: Fix the issue of resource not being properly released in xenbus_dev_probe()") Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
parent
bae18180aa
commit
7c138d1284
3 changed files with 16 additions and 3 deletions
|
|
@ -85,6 +85,7 @@ struct xenbus_device {
|
|||
enum xenbus_state state;
|
||||
struct completion down;
|
||||
struct work_struct work;
|
||||
spinlock_t reclaim_lock;
|
||||
};
|
||||
|
||||
static inline struct xenbus_device *to_xenbus_device(struct device *dev)
|
||||
|
|
|
|||
Loading…
Reference in a new issue