[patch 20/47] net_sched: cls_api: fix return value for non-existant classifiers

Greg KH
2008-06-14T00:19:01Z

[-- Attachment #1: net_sched-cls_api-fix-return-value-for-non-existant-classifiers.patch --]
[-- Type: text/plain, Size: 800 bytes --]

-stable review patch. If anyone has any objections, please let us know.

------------------
From: Patrick McHardy <kaber@trash.net>

[ upstream commit: f2df824948d559ea818e03486a8583e42ea6ab37 ]

cls_api should return ENOENT when the requested classifier doesn't
exist.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
net/sched/cls_api.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -220,7 +220,7 @@ replay:
tp = kzalloc(sizeof(*tp), GFP_KERNEL);
if (tp == NULL)
goto errout;
- err = -EINVAL;
+ err = -ENOENT;
tp_ops = tcf_proto_lookup_ops(tca[TCA_KIND]);
if (tp_ops == NULL) {
#ifdef CONFIG_KMOD

--