net: dsa: fix preparation of a port STP update
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>
Tue, 29 Sep 2015 16:38:36 +0000 (12:38 -0400)
committerDavid S. Miller <davem@davemloft.net>
Wed, 30 Sep 2015 04:35:06 +0000 (21:35 -0700)
commitb8d866ac6aa45147b84f3f67b124b82bee675e9f
tree9a40533604c7b4287c57d02ad67a26f431de63c3
parent21fdd092acc7ebda0dfe682008592eb79c382707
net: dsa: fix preparation of a port STP update

Because of the default 0 value of ret in dsa_slave_port_attr_set, a
driver may return -EOPNOTSUPP from the commit phase of a STP state,
which triggers a WARN() from switchdev.

This happened on a 6185 switch which does not support hardware bridging.

Reported-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Acked-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dsa/slave.c