mt76: mt7915: fix hwmon temp sensor mem use-after-free
authorBen Greear <greearb@candelatech.com>
Thu, 2 Sep 2021 05:52:03 +0000 (13:52 +0800)
committerFelix Fietkau <nbd@nbd.name>
Wed, 20 Oct 2021 08:36:40 +0000 (10:36 +0200)
commit0ae3ff5684514d72357240f1033a7494c51f93ed
tree7c3e99c8bb84119696f1132c6eb057ec0f1af754
parent68ee6a14fe628d3d56dec8535f41a2a4f3ae6709
mt76: mt7915: fix hwmon temp sensor mem use-after-free

Without this change, garbage is seen in the hwmon name and sensors output
for mt7915 is garbled. It appears that the hwmon logic does not make a
copy of the incoming string, but instead just copies a char* and expects
it to never go away.

Fixes: 33fe9c639c13 ("mt76: mt7915: add thermal sensor device support")
Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7915/init.c