media: intel/ipu6: Fix an error handling path in isys_probe()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 26 May 2024 07:59:57 +0000 (09:59 +0200)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Tue, 28 May 2024 06:00:14 +0000 (08:00 +0200)
commitab0ed481012811fed052f609b364c118ce8a576e
tree5f0330565ed01acf8024daf9cb94f8622093f4f7
parent266b44ec9a26dd2ad5d1dfcbb2f7f4e2c10da3fb
media: intel/ipu6: Fix an error handling path in isys_probe()

If an error occurs after a successful alloc_fw_msg_bufs() call, some
resources should be released as already done in the remove function.

Add a new free_fw_msg_bufs() function that releases what has been allocated
by alloc_fw_msg_bufs().

Also use this new function in isys_remove() to avoid some code duplication.

Fixes: f50c4ca0a820 ("media: intel/ipu6: add the main input system driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/pci/intel/ipu6/ipu6-isys.c