Commit 4d604c6f authored by Joey Zhang's avatar Joey Zhang Committed by Greg Kroah-Hartman
Browse files

switchtec: Fix SWITCHTEC_IOCTL_EVENT_IDX_ALL flags overwrite



[ Upstream commit e4a7dca5 ]

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: 52eabba5 ("switchtec: Add IOCTLs to the Switchtec driver")
Signed-off-by: default avatarJoey Zhang <joey.zhang@microchip.com>
Signed-off-by: default avatarWesley Sheng <wesley.sheng@microchip.com>
[bhelgaas: changelog]
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Reviewed-by: default avatarLogan Gunthorpe <logang@deltatee.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 570f3183
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment