input: qti-haptics: ensure valid pointer when calling kfree
In haptics pattern/brake debugfs file write operation functions,
strsep() is used iteratively to split the user-passed string into
tokens for setting parameters. However, strsep() modifies the pointer
passed and hence the same pointer cannot be used in kfree(). Fix this
by copying the pointer originally allocated by kmalloc() and use it
in kfree() as well. While at it, change kmalloc() to kzalloc().
Change-Id: I5a4c08db32683dfe5e4fefbce146fee1ac6cb88b
Signed-off-by:
Fenglin Wu <fenglinw@codeaurora.org>
Loading
Please register or sign in to comment