mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 13:41:30 +00:00
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>
This commit is contained in:
parent
1954dc1177
commit
ad72c347e5
9 changed files with 19 additions and 1 deletions
|
@ -592,6 +592,8 @@ 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)
|
||||
return -EOPNOTSUPP;
|
||||
priv->ctrlmode &= ~cm->mask;
|
||||
priv->ctrlmode |= cm->flags;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue