generic: fix kernel panic on existing mac-address node
authorDavid Bauer <mail@david-bauer.net>
Mon, 9 Aug 2021 22:28:01 +0000 (00:28 +0200)
committerDavid Bauer <mail@david-bauer.net>
Tue, 10 Aug 2021 11:13:01 +0000 (13:13 +0200)
commit29a3967e61334d0c6a1a7d391f0e751272d77b1d
tree1c24665066f822c118046535b10c5e0d7c5dca78
parent5ecd99f7d2f3456a9178e030bbed68e687b904ce
generic: fix kernel panic on existing mac-address node

Calling free for the OF property can result in a kernel panic, as the
buffer in question might be referenced elsewhere. Also, it is not
removed from the tree.

Always allocate a new property and updating the tree with it fixes both
issues.

Fixes commit 91a52f22a13d ("treewide: backport support for nvmem on non platform devices")

Signed-off-by: David Bauer <mail@david-bauer.net>
target/linux/generic/pending-5.10/683-of_net-add-mac-address-to-of-tree.patch
target/linux/generic/pending-5.4/683-of_net-add-mac-address-to-of-tree.patch