diff options
author | Oliver Hartkopp <socketcan@hartkopp.net> | 2016-06-21 12:14:07 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-08-10 10:21:03 +0200 |
commit | 6f8f768a3586b6fbd50e249e7fe4f964a6994685 (patch) | |
tree | 484731d35e7758e63e690446b957988e84a43da0 /drivers | |
parent | 5c3a7aac3d8dc9baa708c7ce37df2dbae3098d1d (diff) | |
download | lwn-6f8f768a3586b6fbd50e249e7fe4f964a6994685.tar.gz lwn-6f8f768a3586b6fbd50e249e7fe4f964a6994685.zip |
can: fix handling of unmodifiable configuration options fix
commit bce271f255dae8335dc4d2ee2c4531e09cc67f5a upstream.
With upstream commit bb208f144cf3f59 (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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/can/dev.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c index 84ad2b44377c..0c5c745cda4c 100644 --- a/drivers/net/can/dev.c +++ b/drivers/net/can/dev.c @@ -665,6 +665,9 @@ static int can_changelink(struct net_device *dev, } } + if (!data) + return 0; + if (data[IFLA_CAN_CTRLMODE]) { struct can_ctrlmode *cm; |