Commit 61d51456 authored by Daniel Vetter's avatar Daniel Vetter Committed by Greg Kroah-Hartman

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 ddde3c18 ("vt:
More locking checks").
Reported-by: default avatarJens Remus <jremus@linux.ibm.com>
Cc: linux-kernel@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-fbdev@vger.kernel.org
Cc: linux-s390@vger.kernel.org
Cc: Nicolas Pitre <nicolas.pitre@linaro.org>
Cc: Martin Hostettler <textshell@uchuujin.de>
Cc: Adam Borowski <kilobyte@angband.pl>
Cc: Mikulas Patocka <mpatocka@redhat.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Sam Ravnborg <sam@ravnborg.org>
Fixes: ddde3c18 ("vt: More locking checks")
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
Tested-by: default avatarJens Remus <jremus@linux.ibm.com>
Acked-by: default avatarSam Ravnborg <sam@ravnborg.org>
Link: https://lore.kernel.org/r/20190718080903.22622-1-daniel.vetter@ffwll.chSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4a2b8560
...@@ -3771,7 +3771,11 @@ static ssize_t show_bind(struct device *dev, struct device_attribute *attr, ...@@ -3771,7 +3771,11 @@ static ssize_t show_bind(struct device *dev, struct device_attribute *attr,
char *buf) char *buf)
{ {
struct con_driver *con = dev_get_drvdata(dev); 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); return snprintf(buf, PAGE_SIZE, "%i\n", bind);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment