diff options
author | David S. Miller <davem@davemloft.net> | 2015-01-28 01:59:56 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-01-28 01:59:56 +0100 |
commit | 95f873f2fff96c592c5d863e2a39825bd8bf0500 (patch) | |
tree | 0d2dd664964ba2c701aefea5b4d1e85b481045e1 /drivers/net/can/dev.c | |
parent | netlink: Kill redundant net argument in netlink_insert (diff) | |
parent | Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net (diff) | |
download | linux-95f873f2fff96c592c5d863e2a39825bd8bf0500.tar.xz linux-95f873f2fff96c592c5d863e2a39825bd8bf0500.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
arch/arm/boot/dts/imx6sx-sdb.dts
net/sched/cls_bpf.c
Two simple sets of overlapping changes.
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 | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c index 6ac02c8d747e..3c82e02e3dae 100644 --- a/drivers/net/can/dev.c +++ b/drivers/net/can/dev.c @@ -808,10 +808,14 @@ static int can_changelink(struct net_device *dev, if (dev->flags & IFF_UP) return -EBUSY; cm = nla_data(data[IFLA_CAN_CTRLMODE]); - if (cm->flags & ~priv->ctrlmode_supported) + + /* check whether changed bits are allowed to be modified */ + if (cm->mask & ~priv->ctrlmode_supported) return -EOPNOTSUPP; + + /* clear bits to be modified and copy the flag values */ priv->ctrlmode &= ~cm->mask; - priv->ctrlmode |= cm->flags; + priv->ctrlmode |= (cm->flags & cm->mask); /* CAN_CTRLMODE_FD can only be set when driver supports FD */ if (priv->ctrlmode & CAN_CTRLMODE_FD) |