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)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 10 Dec 2015 09:37:51 +0000 (10:37 +0100)
commitb7bb110008607a915298bf0f47d25886ecb94477
treef024cb45187d06fb2afb5e89ed51f2443595deb8
parentc1df932c0574c13ab3ce72e969c9647ff3aaad68
rfkill: copy the name into the rfkill struct

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().

Cc: stable@vger.kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/rfkill/core.c
This page took 0.027215 seconds and 5 git commands to generate.