Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Joonwoo Park and committed by
David S. Miller
43138833 2523c3fc

+5 -1
+5 -1
lib/ts_fsm.c
··· 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; ··· 267 267 size_t priv_size = sizeof(*fsm) + len; 268 268 269 269 if (len % sizeof(struct ts_fsm_token) || ntokens < 1) 270 + goto errout; 271 + 272 + if (flags & TS_IGNORECASE) 270 273 goto errout; 271 274 272 275 for (i = 0; i < ntokens; i++) { ··· 287 284 if (IS_ERR(conf)) 288 285 return conf; 289 286 287 + conf->flags = flags; 290 288 fsm = ts_config_priv(conf); 291 289 fsm->ntokens = ntokens; 292 290 memcpy(fsm->tokens, pattern, len);