]> www.infradead.org Git - users/jedix/linux-maple.git/commit
switchtec: Fix SWITCHTEC_IOCTL_EVENT_IDX_ALL flags overwrite
authorJoey Zhang <joey.zhang@microchip.com>
Mon, 10 Dec 2018 09:12:22 +0000 (17:12 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Feb 2019 18:46:04 +0000 (19:46 +0100)
commitcf96f234ef4f3ad6b43c968c77c307271537692a
tree935a2cbe4fa6eae8059d56058538599cf034f921
parent285187e29616daed36a77812a96f1666eb2d6c5d
switchtec: Fix SWITCHTEC_IOCTL_EVENT_IDX_ALL flags overwrite

[ Upstream commit e4a7dca5de625018b29417ecc39dc5037d9a5a36 ]

In the ioctl_event_ctl() SWITCHTEC_IOCTL_EVENT_IDX_ALL case, we call
event_ctl() several times with the same "ctl" struct.  Each call clobbers
ctl.flags, which leads to the problem that we may not actually enable or
disable all events as the user requested.

Preserve the event flag value with a temporary variable.

Fixes: 52eabba5bcdb ("switchtec: Add IOCTLs to the Switchtec driver")
Signed-off-by: Joey Zhang <joey.zhang@microchip.com>
Signed-off-by: Wesley Sheng <wesley.sheng@microchip.com>
[bhelgaas: changelog]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pci/switch/switchtec.c