gpio: sim: initialize a managed pointer when declaring it
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Sun, 17 Sep 2023 08:58:37 +0000 (10:58 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Nov 2023 10:59:04 +0000 (11:59 +0100)
commit5d8a3bf5dcee4e8ad185557cee50691a20a42e11
tree4ff3dd225f051a14dec9663855b37936d01efcbd
parentf171bab88e59c3a72efbd7357540586e1ff3a5cf
gpio: sim: initialize a managed pointer when declaring it

[ Upstream commit 9f93f18305f5777820491e6ab9b34422c160371b ]

Variables managed with __free() should typically be initialized where
they are declared so that the __free() callback is paired with its
counterpart resource allocator. Fix the second instance of using
__free() in gpio-sim to follow this pattern.

Fixes: 3faf89f27aab ("gpio: sim: simplify code with cleanup helpers")
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpio/gpio-sim.c