can: raw: use temp variable instead of rolling back config
authorOliver Hartkopp <socketcan@hartkopp.net>
Fri, 3 Feb 2023 09:08:07 +0000 (10:08 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 8 Feb 2023 20:53:24 +0000 (21:53 +0100)
commitf2f527d595963aa86464ca3e05ec27dd5153d56e
tree35319326bb4432bc1434d68ba5899f29609f4c7a
parente6ebe6c12355538e9238e2051bd6757b12dbfe9c
can: raw: use temp variable instead of rolling back config

Introduce a temporary variable to check for an invalid configuration
attempt from user space. Before this patch the value was copied to
the real config variable and rolled back in the case of an error.

Suggested-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Link: https://lore.kernel.org/all/20230203090807.97100-1-socketcan@hartkopp.net
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
net/can/raw.c