Skip to content

Commit c34da5e

Browse files
author
JoeyZhang-Microsemi
committed
When an event_ctl IOCTL is received with an index of SWITCHTEC_IOCTL_EVENT_IDX_ALL,
the event flags are not set correctly for all the events because they are overwritten by first call of event_ctl().
1 parent 755d5c5 commit c34da5e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

switchtec.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -821,6 +821,7 @@ static int ioctl_event_ctl(struct switchtec_dev *stdev,
821821
{
822822
int ret;
823823
int nr_idxs;
824+
unsigned int event_flags;
824825
struct switchtec_ioctl_event_ctl ctl;
825826

826827
if (copy_from_user(&ctl, uctl, sizeof(ctl)))
@@ -842,7 +843,9 @@ static int ioctl_event_ctl(struct switchtec_dev *stdev,
842843
else
843844
return -EINVAL;
844845

846+
event_flags = ctl.flags;
845847
for (ctl.index = 0; ctl.index < nr_idxs; ctl.index++) {
848+
ctl.flags = event_flags;
846849
ret = event_ctl(stdev, &ctl);
847850
if (ret < 0)
848851
return ret;

0 commit comments

Comments
 (0)