]> git.baikalelectronics.ru Git - kernel.git/commit
USB: cdc-acm: restore capability check order
authorMatthias Reichl <hias@horus.com>
Fri, 27 Mar 2020 15:03:50 +0000 (16:03 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Mar 2020 15:24:16 +0000 (16:24 +0100)
commit7d577996565517d7ad2befefcbf30fb5e8298f00
treeb270c4ae6d4bf12cb5c25d9ac8f1248ae16e1e84
parent8a6dda543786bc156ea40500e640fa592d147a40
USB: cdc-acm: restore capability check order

commit 984c281a051e5 ("USB: cdc-acm: fix rounding error in TIOCSSERIAL")
introduced a regression by changing the order of capability and close
settings change checks. When running with CAP_SYS_ADMIN setting the
close settings to the values already set resulted in -EOPNOTSUPP.

Fix this by changing the check order back to how it was before.

Fixes: 984c281a051e5 ("USB: cdc-acm: fix rounding error in TIOCSSERIAL")
Cc: Anthony Mallet <anthony.mallet@laas.fr>
Cc: stable <stable@vger.kernel.org>
Cc: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Matthias Reichl <hias@horus.com>
Link: https://lore.kernel.org/r/20200327150350.3657-1-hias@horus.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/class/cdc-acm.c