Commit 43138833ee9af07e865a4dcbfe81684c9c2f2262
Committed by
David S. Miller
1 parent
2523c3fc2b
Exists in
master
and in
7 other branches
textsearch: ts_fsm: return error on request for case insensitive search
For fsm text search, handle case insensitive parameter as -EINVAL. Signed-off-by: Joonwoo Park <joonwpark81@gmail.com> Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Showing 1 changed file with 5 additions and 1 deletions Side-by-side Diff
lib/ts_fsm.c
... | ... | @@ -257,7 +257,7 @@ |
257 | 257 | } |
258 | 258 | |
259 | 259 | static struct ts_config *fsm_init(const void *pattern, unsigned int len, |
260 | - gfp_t gfp_mask) | |
260 | + gfp_t gfp_mask, int flags) | |
261 | 261 | { |
262 | 262 | int i, err = -EINVAL; |
263 | 263 | struct ts_config *conf; |
... | ... | @@ -269,6 +269,9 @@ |
269 | 269 | if (len % sizeof(struct ts_fsm_token) || ntokens < 1) |
270 | 270 | goto errout; |
271 | 271 | |
272 | + if (flags & TS_IGNORECASE) | |
273 | + goto errout; | |
274 | + | |
272 | 275 | for (i = 0; i < ntokens; i++) { |
273 | 276 | struct ts_fsm_token *t = &tokens[i]; |
274 | 277 | |
... | ... | @@ -284,6 +287,7 @@ |
284 | 287 | if (IS_ERR(conf)) |
285 | 288 | return conf; |
286 | 289 | |
290 | + conf->flags = flags; | |
287 | 291 | fsm = ts_config_priv(conf); |
288 | 292 | fsm->ntokens = ntokens; |
289 | 293 | memcpy(fsm->tokens, pattern, len); |