]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
rfkill: copy the name into the rfkill struct
authorJohannes Berg <johannes.berg@intel.com>
Thu, 10 Dec 2015 09:37:51 +0000 (10:37 +0100)
committerZefan Li <lizefan@huawei.com>
Wed, 26 Oct 2016 15:15:36 +0000 (23:15 +0800)
commit322d37f032a4d06408af44919ad969b02543afd0
tree4383bf94f524f99c6bee4a6f76127350a8275e8d
parentc5596fe183a9b36aae8c30334767014b6250350c
rfkill: copy the name into the rfkill struct

commit b7bb110008607a915298bf0f47d25886ecb94477 upstream.

Some users of rfkill, like NFC and cfg80211, use a dynamic name when
allocating rfkill, in those cases dev_name(). Therefore, the pointer
passed to rfkill_alloc() might not be valid forever, I specifically
found the case that the rfkill name was quite obviously an invalid
pointer (or at least garbage) when the wiphy had been renamed.

Fix this by making a copy of the rfkill name in rfkill_alloc().

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Zefan Li <lizefan@huawei.com>
net/rfkill/core.c