Skip to content
Commit d537afa0 authored by Nicolas Saenz Julienne's avatar Nicolas Saenz Julienne Committed by Greg Kroah-Hartman
Browse files

firmware: raspberrypi: Keep count of all consumers



[ Upstream commit 1e7c5735 ]

When unbinding the firmware device we need to make sure it has no
consumers left. Otherwise we'd leave them with a firmware handle
pointing at freed memory.

Keep a reference count of all consumers and introduce rpi_firmware_put()
which will permit automatically decrease the reference count upon
unbinding consumer drivers.

Suggested-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarNicolas Saenz Julienne <nsaenzjulienne@suse.de>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Reviewed-by: default avatarStephen Boyd <sboyd@kernel.org>
Reviewed-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
Stable-dep-of: 5bca3688 ("Input: raspberrypi-ts - fix refcount leak in rpi_ts_probe")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 919f4703
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment