Skip to content

Commit

Permalink
can: fix handling of unmodifiable configuration options fix
Browse files Browse the repository at this point in the history
commit bce271f upstream.

With upstream commit bb208f1 (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>
  • Loading branch information
Oliver Hartkopp authored and Greg Kroah-Hartman committed Aug 10, 2016
1 parent 5c3a7aa commit 6f8f768
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/can/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 6f8f768

Please sign in to comment.