mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
xen/xenbus: fix locking
[ Upstream commit 2f69a110e7bba3ec6bc089a2f736ca0941d887ed ]
Commit 060eabe8fbe726 ("xenbus/backend: Protect xenbus callback with
lock") introduced a bug by holding a lock while calling a function
which might schedule.
Fix that by using a semaphore instead.
Fixes: 060eabe8fbe726 ("xenbus/backend: Protect xenbus callback with lock")
Signed-off-by: Juergen Gross <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Boris Ostrovsky <[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
7c138d1284
commit
1c264dd643
3 changed files with 10 additions and 8 deletions
|
|
@ -42,6 +42,7 @@
|
|||
#include <linux/completion.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/semaphore.h>
|
||||
#include <xen/interface/xen.h>
|
||||
#include <xen/interface/grant_table.h>
|
||||
#include <xen/interface/io/xenbus.h>
|
||||
|
|
@ -85,7 +86,7 @@ struct xenbus_device {
|
|||
enum xenbus_state state;
|
||||
struct completion down;
|
||||
struct work_struct work;
|
||||
spinlock_t reclaim_lock;
|
||||
struct semaphore reclaim_sem;
|
||||
};
|
||||
|
||||
static inline struct xenbus_device *to_xenbus_device(struct device *dev)
|
||||
|
|
|
|||
Loading…
Reference in a new issue