Commit 42046e2e45c109ba703993c510401a11f716c8df

Authored by Patrick McHardy
1 parent adb00ae2ea

netfilter: x_tables: return -ENOENT for non-existant matches/targets

As Stephen correctly points out, we need to return -ENOENT in
xt_find_match()/xt_find_target() after the patch "netfilter: x_tables:
misuse of try_then_request_module" in order to properly indicate
a non-existant module to the caller.

Signed-off-by: Patrick McHardy <kaber@trash.net>

Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff

net/netfilter/x_tables.c
... ... @@ -190,7 +190,7 @@
190 190 struct xt_match *xt_find_match(u8 af, const char *name, u8 revision)
191 191 {
192 192 struct xt_match *m;
193   - int err = 0;
  193 + int err = -ENOENT;
194 194  
195 195 if (mutex_lock_interruptible(&xt[af].mutex) != 0)
196 196 return ERR_PTR(-EINTR);
... ... @@ -235,7 +235,7 @@
235 235 struct xt_target *xt_find_target(u8 af, const char *name, u8 revision)
236 236 {
237 237 struct xt_target *t;
238   - int err = 0;
  238 + int err = -ENOENT;
239 239  
240 240 if (mutex_lock_interruptible(&xt[af].mutex) != 0)
241 241 return ERR_PTR(-EINTR);