History

netfilter: xtables: change targets to return error code

Part of the transition of done by this semantic patch: // <smpl> @ rule1 @ struct xt_target ops; identifier check; @@ ops.checkentry = check; @@ identifier rule1.check; @@ check(...) { <... -return true; +return 0; ...> } @@ identifier rule1.check; @@ check(...) { <... -return false; +return -EINVAL; ...> } // </smpl>

Jan Engelhardt committed 16 years ago

Commit d6b00a51 parent bd414ee31 files · +116 −111Browse files

Showing the changes to net/netfilter/xt_LED.c (1 of 31 files). Show all

Unified · Split

net/netfilter/xt_LED.c+4−6
@@ -88,12 +88,12 @@ static int led_tg_check(const struct xt_tgchk_param *par) · 87 unmodified lines
8888
8989 if (ledinfo->id[0] == '\0') {
9090 pr_info("No 'id' parameter given.\n");
91− return false;
91+ return -EINVAL;
9292 }
9393
9494 ledinternal = kzalloc(sizeof(struct xt_led_info_internal), GFP_KERNEL);
9595 if (!ledinternal)
96− return false;
96+ return -EINVAL;
9797
9898 ledinternal->netfilter_led_trigger.name = ledinfo->id;
9999
@@ -111,13 +111,11 @@ static int led_tg_check(const struct xt_tgchk_param *par) · 11 unmodified lines
111111 (unsigned long)ledinfo);
112112
113113 ledinfo->internal_data = ledinternal;
114−
115− return true;
114+ return 0;
116115
117116 exit_alloc:
118117 kfree(ledinternal);
119−
120− return false;
118+ return -EINVAL;
121119 }
122120
123121 static void led_tg_destroy(const struct xt_tgdtor_param *par)