]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: hi556: Fix memory leak (on error) in hi556_check_hwcfg()
authorHans de Goede <hdegoede@redhat.com>
Thu, 19 Dec 2024 19:27:30 +0000 (20:27 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 20 Apr 2025 08:15:35 +0000 (10:15 +0200)
commitf67c3f84520b4069761119e25cdf283bc026563c
treebb612a445183ccc2f93d3b12fb10b7021390eb12
parentdf6ef66cc3ff93287d38b4bec043c8a0596a2701
media: hi556: Fix memory leak (on error) in hi556_check_hwcfg()

commit ed554da65abd0c561e40d35272d1a61d030fe977 upstream.

Commit 7d968b5badfc ("media: hi556: Return -EPROBE_DEFER if no endpoint is
found") moved the v4l2_fwnode_endpoint_alloc_parse() call in
hi556_check_hwcfg() up, but it did not make the error-exit paths between
the old and new call-site use "goto check_hwcfg_error;" to free the bus_cfg
on errors.

Add the missing "goto check_hwcfg_error;" statements to fix a memleak on
early error-exits from hi556_check_hwcfg().

Fixes: 7d968b5badfc ("media: hi556: Return -EPROBE_DEFER if no endpoint is found")
Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/i2c/hi556.c