mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
intel_th: msu: Prevent freeing buffers while locked windows exist
We already prevent freeing buffers via sysfs interface in case there are existing users or if trace is active. Treat the existence of locked windows similarly and return -EBUSY on attempts to free the buffer. When the last window is unlocked, the freeing will succeed. Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20190705141425.19894-5-alexander.shishkin@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
57b69a1f66
commit
ed5207afc5
1 changed files with 5 additions and 0 deletions
|
@ -724,6 +724,11 @@ static int msc_win_set_lockout(struct msc_window *win,
|
|||
|
||||
win->lockout = new;
|
||||
|
||||
if (old == expect && new == WIN_LOCKED)
|
||||
atomic_inc(&win->msc->user_count);
|
||||
else if (old == expect && old == WIN_LOCKED)
|
||||
atomic_dec(&win->msc->user_count);
|
||||
|
||||
unlock:
|
||||
spin_unlock_irqrestore(&win->lo_lock, flags);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue