Skip to content

Commit 61d5145

Browse files
danvetgregkh
authored andcommitted
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 ddde3c1 ("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: ddde3c1 ("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]>
1 parent 4a2b856 commit 61d5145

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/tty/vt/vt.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3771,7 +3771,11 @@ static ssize_t show_bind(struct device *dev, struct device_attribute *attr,
37713771
char *buf)
37723772
{
37733773
struct con_driver *con = dev_get_drvdata(dev);
3774-
int bind = con_is_bound(con->con);
3774+
int bind;
3775+
3776+
console_lock();
3777+
bind = con_is_bound(con->con);
3778+
console_unlock();
37753779

37763780
return snprintf(buf, PAGE_SIZE, "%i\n", bind);
37773781
}

0 commit comments

Comments
 (0)