OSDN Git Service

regmap: potentially duplicate the name string stored in regmap
authorBartosz Golaszewski <brgl@bgdev.pl>
Wed, 13 Dec 2017 16:25:31 +0000 (17:25 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 13 Dec 2017 16:46:45 +0000 (16:46 +0000)
commit8253bb3f82554cedb830a4cb65c84796df129c81
tree7599309d4e4048ac3df30e9696073c28e7b38e21
parent4045559c099998642e35d1444251c3bf042c7a4f
regmap: potentially duplicate the name string stored in regmap

Currently we just copy over the pointer passed to regmap_init() in
the regmap config struct. To be on the safe side: duplicate the string
with kstrdup_const() so that if an unaware user passes an address to
a stack-allocated buffer, we won't crash.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/base/regmap/regmap.c