]> git.karo-electronics.de Git - karo-tx-linux.git/commit
greybus: bundle: use kstrdup() for state file
authorAlex Elder <elder@linaro.org>
Fri, 17 Apr 2015 19:41:47 +0000 (14:41 -0500)
committerGreg Kroah-Hartman <gregkh@google.com>
Fri, 1 May 2015 14:41:11 +0000 (16:41 +0200)
commit22fd2a8ade59bb97f0a64282ba5b3903ba3e9e89
treea6188c48e82f0098c03812f430a321d019e0fa02
parent55b930cd17a7cd66a1fb2a587660a344ea5a9ee2
greybus: bundle: use kstrdup() for state file

The kernfs code guarantees we'll get a NUL-terminated buffer.
Use kstrdup() rather than kzalloc() + memcpy() in state_store()
making it slightly clearer what we're doing.  This has the added
benefit of guaranteeing that the stored string has no NUL character
inside it.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/bundle.c