Skip to content

Commit 4313883

Browse files
joonwparkdavem330
authored andcommitted
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 <[email protected]> Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 2523c3f commit 4313883

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/ts_fsm.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ static unsigned int fsm_find(struct ts_config *conf, struct ts_state *state)
257257
}
258258

259259
static struct ts_config *fsm_init(const void *pattern, unsigned int len,
260-
gfp_t gfp_mask)
260+
gfp_t gfp_mask, int flags)
261261
{
262262
int i, err = -EINVAL;
263263
struct ts_config *conf;
@@ -269,6 +269,9 @@ static struct ts_config *fsm_init(const void *pattern, unsigned int len,
269269
if (len % sizeof(struct ts_fsm_token) || ntokens < 1)
270270
goto errout;
271271

272+
if (flags & TS_IGNORECASE)
273+
goto errout;
274+
272275
for (i = 0; i < ntokens; i++) {
273276
struct ts_fsm_token *t = &tokens[i];
274277

@@ -284,6 +287,7 @@ static struct ts_config *fsm_init(const void *pattern, unsigned int len,
284287
if (IS_ERR(conf))
285288
return conf;
286289

290+
conf->flags = flags;
287291
fsm = ts_config_priv(conf);
288292
fsm->ntokens = ntokens;
289293
memcpy(fsm->tokens, pattern, len);

0 commit comments

Comments
 (0)