diff mbox series

[33/40] media: atomisp: fix __get_frame_info() error handling

Message ID 20220613195137.8117-34-hdegoede@redhat.com
State Accepted
Commit 3bde235bf6780e741d602deb570a8bd7e10a685d
Headers show
Series media: atomisp: Various hmm and other cleanups | expand

Commit Message

Hans de Goede June 13, 2022, 7:51 p.m. UTC
On ia_css_pipe_get_info() errors, destroy both the streams as well
as the pipes which were created.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/staging/media/atomisp/pci/atomisp_compat_css20.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
index 6e91654ce5da..d03b29add5c3 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
@@ -2653,7 +2653,7 @@  static int __get_frame_info(struct atomisp_sub_device *asd,
 				   &p_info);
 	if (ret) {
 		dev_err(isp->dev, "can't get info from pipe\n");
-		goto stream_err;
+		goto get_info_err;
 	}
 
 	switch (type) {
@@ -2684,6 +2684,8 @@  static int __get_frame_info(struct atomisp_sub_device *asd,
 
 	return 0;
 
+get_info_err:
+	__destroy_streams(asd, true);
 stream_err:
 	__destroy_pipes(asd, true);
 	return -EINVAL;