]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: check out-of-range ageing time value
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>
Wed, 15 Mar 2017 19:53:49 +0000 (15:53 -0400)
committerDavid S. Miller <davem@davemloft.net>
Wed, 15 Mar 2017 22:34:13 +0000 (15:34 -0700)
commit704ca6a2458a320debde7c1bdd4b72b841d96af5
treef5a40b417d8295bc496b39a30acda78e11c09736
parent689ad8e7d8adfa98bb33aa8eff65e477ba3ffe7b
net: dsa: check out-of-range ageing time value

If a DSA switch driver cannot program an ageing time value due to it
being out-of-range, switchdev will raise a stack trace before failing.

To fix this, add ageing_time_min and ageing_time_max members to the
dsa_switch in order for the switch drivers to optionally specify their
supported ageing time limits.

The DSA core will now check for provided ageing time limits and return
-ERANGE from the switchdev prepare phase if the value is out-of-range.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/dsa.h
net/dsa/slave.c