mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 18:09:56 +00:00
can: fix handling of unmodifiable configuration options fix
commitbce271f255upstream. With upstream commitbb208f144c(can: fix handling of unmodifiable configuration options) a new can_validate() function was introduced. When invoking 'ip link set can0 type can' without any configuration data can_validate() tries to validate the content without taking into account that there's totally no content. This patch adds a check for missing content. Reported-by: ajneu <ajneu1@gmail.com> Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
popcornmix
parent
b403aa8a40
commit
5dccaecd48
@@ -798,6 +798,9 @@ static int can_validate(struct nlattr *tb[], struct nlattr *data[])
|
|||||||
* - control mode with CAN_CTRLMODE_FD set
|
* - control mode with CAN_CTRLMODE_FD set
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if (!data)
|
||||||
|
return 0;
|
||||||
|
|
||||||
if (data[IFLA_CAN_CTRLMODE]) {
|
if (data[IFLA_CAN_CTRLMODE]) {
|
||||||
struct can_ctrlmode *cm = nla_data(data[IFLA_CAN_CTRLMODE]);
|
struct can_ctrlmode *cm = nla_data(data[IFLA_CAN_CTRLMODE]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user