diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-05-31 09:50:26 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-05-31 09:50:26 +0200 |
| commit | aa10fab0f859ef86e998ee1cdaa89fc8e542e2c9 (patch) | |
| tree | d76af7ad635537fa59e033306f900408cd470168 /net/dsa/slave.c | |
| parent | 7652dd2c5cb7b656471cc801d619fe24120643a3 (diff) | |
| parent | 8124c8a6b35386f73523d27eacb71b5364a68c4c (diff) | |
Merge 5.13-rc4 into usb-next
We need the usb/thunderbolt fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/dsa/slave.c')
| -rw-r--r-- | net/dsa/slave.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c index 8c0f3c6ab365..d4756b920108 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -776,13 +776,15 @@ static int dsa_slave_get_sset_count(struct net_device *dev, int sset) struct dsa_switch *ds = dp->ds; if (sset == ETH_SS_STATS) { - int count; + int count = 0; - count = 4; - if (ds->ops->get_sset_count) - count += ds->ops->get_sset_count(ds, dp->index, sset); + if (ds->ops->get_sset_count) { + count = ds->ops->get_sset_count(ds, dp->index, sset); + if (count < 0) + return count; + } - return count; + return count + 4; } else if (sset == ETH_SS_TEST) { return net_selftest_get_count(); } |
