diff options
| author | Johan Hovold <[email protected]> | 2021-12-01 13:25:26 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2021-12-21 09:14:52 +0000 |
| commit | 47a1db8e797da01a1309bf42e0c0d771d4e4d4f3 (patch) | |
| tree | 6044d9a5f293d8774e268867e772c6ea53149139 /drivers/iio/trigger/stm32-timer-trigger.c | |
| parent | firmware: qemu_fw_cfg: fix NULL-pointer deref on duplicate entries (diff) | |
| download | kernel-47a1db8e797da01a1309bf42e0c0d771d4e4d4f3.tar.gz kernel-47a1db8e797da01a1309bf42e0c0d771d4e4d4f3.zip | |
firmware: qemu_fw_cfg: fix kobject leak in probe error path
An initialised kobject must be freed using kobject_put() to avoid
leaking associated resources (e.g. the object name).
Commit fe3c60684377 ("firmware: Fix a reference count leak.") "fixed"
the leak in the first error path of the file registration helper but
left the second one unchanged. This "fix" would however result in a NULL
pointer dereference due to the release function also removing the never
added entry from the fw_cfg_entry_cache list. This has now been
addressed.
Fix the remaining kobject leak by restoring the common error path and
adding the missing kobject_put().
Fixes: 75f3e8e47f38 ("firmware: introduce sysfs driver for QEMU's fw_cfg device")
Cc: [email protected] # 4.6
Cc: Gabriel Somlo <[email protected]>
Signed-off-by: Johan Hovold <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'drivers/iio/trigger/stm32-timer-trigger.c')
0 files changed, 0 insertions, 0 deletions
