diff options
author | Ivan Vecera <ivecera@redhat.com> | 2019-02-15 11:23:25 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-02-18 00:39:08 +0100 |
commit | aaeb1dea514a47e25b4dc05deb54fc4dc538d1d5 (patch) | |
tree | 4b19975ebd45fc02386707667516ea6e3c4a3453 /net/sched/sch_api.c | |
parent | net: phy: marvell10g: Don't explicitly set Pause and Asym_Pause (diff) | |
download | linux-aaeb1dea514a47e25b4dc05deb54fc4dc538d1d5.tar.xz linux-aaeb1dea514a47e25b4dc05deb54fc4dc538d1d5.zip |
net: sched: sch_api: set an error msg when qdisc_alloc_handle() fails
This patch sets an error message in extack when the number of qdisc
handles exceeds the maximum. Also the error-code ENOSPC is more
appropriate than ENOMEM in this situation.
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Reported-by: Li Shuang <shuali@redhat.com>
Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_api.c')
-rw-r--r-- | net/sched/sch_api.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index 2283924fb56d..b8a388e4bcc4 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c @@ -1201,9 +1201,11 @@ static struct Qdisc *qdisc_create(struct net_device *dev, } else { if (handle == 0) { handle = qdisc_alloc_handle(dev); - err = -ENOMEM; - if (handle == 0) + if (handle == 0) { + NL_SET_ERR_MSG(extack, "Maximum number of qdisc handles was exceeded"); + err = -ENOSPC; goto err_out3; + } } if (!netif_is_multiqueue(dev)) sch->flags |= TCQ_F_ONETXQUEUE; |