Skip to content

Commit

Permalink
textsearch: convert kmalloc + memset to kzalloc
Browse files Browse the repository at this point in the history
convert kmalloc + memset to kzalloc for alloc_ts_config

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>
  • Loading branch information
Joonwoo Park authored and David S. Miller committed Jul 8, 2008
1 parent 4313883 commit dde77e6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions include/linux/textsearch.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,10 @@ static inline struct ts_config *alloc_ts_config(size_t payload,
{
struct ts_config *conf;

conf = kmalloc(TS_PRIV_ALIGN(sizeof(*conf)) + payload, gfp_mask);
conf = kzalloc(TS_PRIV_ALIGN(sizeof(*conf)) + payload, gfp_mask);
if (conf == NULL)
return ERR_PTR(-ENOMEM);

memset(conf, 0, TS_PRIV_ALIGN(sizeof(*conf)) + payload);
return conf;
}

Expand Down

0 comments on commit dde77e6

Please sign in to comment.