aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vetter <[email protected]>2019-07-18 10:09:03 +0200
committerGreg Kroah-Hartman <[email protected]>2019-07-25 13:47:35 +0200
commit61d51456f35760a09e8aa1e6ddd247f1547015d3 (patch)
treebd9251376f2282c624aa21417db4b2ae0fa46e87
parent4a2b8560e3dff8637ccb09524650864f60ebab7f (diff)
vt: Grab console_lock around con_is_bound in show_bind
Not really harmful not to, but also not harm in grabbing the lock. And this shuts up a new WARNING I introduced in commit ddde3c18b700 ("vt: More locking checks"). Reported-by: Jens Remus <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: Nicolas Pitre <[email protected]> Cc: Martin Hostettler <[email protected]> Cc: Adam Borowski <[email protected]> Cc: Mikulas Patocka <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Sam Ravnborg <[email protected]> Fixes: ddde3c18b700 ("vt: More locking checks") Signed-off-by: Daniel Vetter <[email protected]> Tested-by: Jens Remus <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r--drivers/tty/vt/vt.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index ec92f36ab5c4..34aa39d1aed9 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -3771,7 +3771,11 @@ static ssize_t show_bind(struct device *dev, struct device_attribute *attr,
char *buf)
{
struct con_driver *con = dev_get_drvdata(dev);
- int bind = con_is_bound(con->con);
+ int bind;
+
+ console_lock();
+ bind = con_is_bound(con->con);
+ console_unlock();
return snprintf(buf, PAGE_SIZE, "%i\n", bind);
}