s390/qeth: lock the card while changing its hsuid
authorJulian Wiedmann <jwi@linux.ibm.com>
Mon, 23 Dec 2019 14:03:22 +0000 (15:03 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Jan 2020 18:49:06 +0000 (19:49 +0100)
commit13dc49dae8a7a7cca74def32c735d3c003a97311
tree05bb83fd03dd79da98874353c5c8134c9c39ada2
parentbe5fa7e252a2b47b2187790e2ed7fbfa57abf598
s390/qeth: lock the card while changing its hsuid

[ Upstream commit 5b6c7b55cfe26224b0f41b1c226d3534c542787f ]

qeth_l3_dev_hsuid_store() initially checks the card state, but doesn't
take the conf_mutex to ensure that the card stays in this state while
being reconfigured.

Rework the code to take this lock, and drop a redundant state check in a
helper function.

Fixes: b333293058aa ("qeth: add support for af_iucv HiperSockets transport")
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/s390/net/qeth_core_main.c
drivers/s390/net/qeth_l3_sys.c