diff options
author | Christian Pellegrin <chripell@fsfe.org> | 2010-01-14 02:08:34 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-01-15 04:39:17 -0500 |
commit | ad72c347e56bf3a0231b9d686e17764157d2961c (patch) | |
tree | 4db03a0abae50edfaf996f43e3f717a57b776fbd /drivers/net/can/dev.c | |
parent | 1954dc11776ef8c06263ba4cd21bf4d25c79a19c (diff) |
can: Proper ctrlmode handling for CAN devices
This patch adds error checking of ctrlmode values for CAN devices. As
an example all availabe bits are implemented in the mcp251x driver.
Signed-off-by: Christian Pellegrin <chripell@fsfe.org>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/can/dev.c')
-rw-r--r-- | drivers/net/can/dev.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c index c1bb29f0322b..f08f1202ff00 100644 --- a/drivers/net/can/dev.c +++ b/drivers/net/can/dev.c | |||
@@ -592,6 +592,8 @@ static int can_changelink(struct net_device *dev, | |||
592 | if (dev->flags & IFF_UP) | 592 | if (dev->flags & IFF_UP) |
593 | return -EBUSY; | 593 | return -EBUSY; |
594 | cm = nla_data(data[IFLA_CAN_CTRLMODE]); | 594 | cm = nla_data(data[IFLA_CAN_CTRLMODE]); |
595 | if (cm->flags & ~priv->ctrlmode_supported) | ||
596 | return -EOPNOTSUPP; | ||
595 | priv->ctrlmode &= ~cm->mask; | 597 | priv->ctrlmode &= ~cm->mask; |
596 | priv->ctrlmode |= cm->flags; | 598 | priv->ctrlmode |= cm->flags; |
597 | } | 599 | } |