Skip to content

Commit

Permalink
netfilter: x_tables: return -ENOENT for non-existant matches/targets
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Patrick McHardy committed Mar 14, 2011
1 parent adb00ae commit 42046e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/netfilter/x_tables.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ EXPORT_SYMBOL(xt_unregister_matches);
struct xt_match *xt_find_match(u8 af, const char *name, u8 revision)
{
struct xt_match *m;
int err = 0;
int err = -ENOENT;

if (mutex_lock_interruptible(&xt[af].mutex) != 0)
return ERR_PTR(-EINTR);
Expand Down Expand Up @@ -235,7 +235,7 @@ EXPORT_SYMBOL_GPL(xt_request_find_match);
struct xt_target *xt_find_target(u8 af, const char *name, u8 revision)
{
struct xt_target *t;
int err = 0;
int err = -ENOENT;

if (mutex_lock_interruptible(&xt[af].mutex) != 0)
return ERR_PTR(-EINTR);
Expand Down

0 comments on commit 42046e2

Please sign in to comment.