OSDN Git Service

stm class: Fix unlocking braino in the error path
authorAlexander Shishkin <alexander.shishkin@linux.intel.com>
Mon, 15 Feb 2016 17:12:05 +0000 (19:12 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Apr 2019 04:23:22 +0000 (06:23 +0200)
commitbc9d781bed9db2fc53da97d9559479e30f509374
treeef5f1bfaa8c36b49c79e61713ba74ae0186568a9
parent65b52bbc35a6c996e92f67301fd0fc85cf523496
stm class: Fix unlocking braino in the error path

[ Upstream commit 1810f2c44817c74ca3d05d1e3981e3a2e2ceb6f5 ]

If an illegal attempt is made to unlink stm source device from an
stm device, the stm device's link spinlock mistakenly remains locked.
While this really shouldn't happen (there's a warning in place), the
locking should remain in order so that we can still recover from this
situation if it indeed does happen.

This patch unifies the unlocking in the exit path of
__stm_source_link_drop() to fix this.

Reported-by: Laurent Fert <laurent.fert@intel.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hwtracing/stm/core.c