mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alain Volmat <alain.volmat@st.com>
To: <hugues.fruchet@st.com>, <mchehab@kernel.org>
Cc: <mcoquelin.stm32@gmail.com>, <alexandre.torgue@st.com>,
	<yannick.fertre@st.com>, <hans.verkuil@cisco.com>,
	<linux-media@vger.kernel.org>,
	<linux-stm32@st-md-mailman.stormreply.com>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <alain.volmat@st.com>
Subject: [PATCH 2/2] media: stm32-dcmi: fix probe error path & module remove
Date: Tue, 28 Jul 2020 08:37:58 +0200	[thread overview]
Message-ID: <1595918278-9724-3-git-send-email-alain.volmat@st.com> (raw)
In-Reply-To: <1595918278-9724-1-git-send-email-alain.volmat@st.com>

This commit add missing vb2_queue_release calls with the
probe error path and module remove.
Missing v4l2_async_notifier_unregister is also added within
the probe error path

Fixes: 37404f91ef8b ("[media] stm32-dcmi: STM32 DCMI camera interface driver")
Signed-off-by: Alain Volmat <alain.volmat@st.com>
---
 drivers/media/platform/stm32/stm32-dcmi.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/stm32/stm32-dcmi.c b/drivers/media/platform/stm32/stm32-dcmi.c
index 5e60d4c6eeeb..57830ee691be 100644
--- a/drivers/media/platform/stm32/stm32-dcmi.c
+++ b/drivers/media/platform/stm32/stm32-dcmi.c
@@ -2004,7 +2004,7 @@ static int dcmi_probe(struct platform_device *pdev)
 
 	ret = dcmi_graph_init(dcmi);
 	if (ret < 0)
-		goto err_media_entity_cleanup;
+		goto err_vb2_queue_release;
 
 	/* Reset device */
 	ret = reset_control_assert(dcmi->rstc);
@@ -2030,7 +2030,10 @@ static int dcmi_probe(struct platform_device *pdev)
 	return 0;
 
 err_cleanup:
+	v4l2_async_notifier_unregister(&dcmi->notifier);
 	v4l2_async_notifier_cleanup(&dcmi->notifier);
+err_vb2_queue_release:
+	vb2_queue_release(q);
 err_media_entity_cleanup:
 	media_entity_cleanup(&dcmi->vdev->entity);
 err_device_release:
@@ -2052,6 +2055,7 @@ static int dcmi_remove(struct platform_device *pdev)
 
 	v4l2_async_notifier_unregister(&dcmi->notifier);
 	v4l2_async_notifier_cleanup(&dcmi->notifier);
+	vb2_queue_release(&dcmi->queue);
 	media_entity_cleanup(&dcmi->vdev->entity);
 	v4l2_device_unregister(&dcmi->v4l2_dev);
 	media_device_cleanup(&dcmi->mdev);
-- 
2.7.4


  parent reply	other threads:[~2020-07-28  6:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-28  6:37 [PATCH 0/2] Error handling fixes in stm32-dcmi driver Alain Volmat
2020-07-28  6:37 ` [PATCH 1/2] media: stm32-dcmi: create video dev within notifier bound Alain Volmat
2020-07-28  7:48   ` Hugues FRUCHET
2020-08-19 13:52   ` Hans Verkuil
2020-07-28  6:37 ` Alain Volmat [this message]
2020-07-28  7:48   ` [PATCH 2/2] media: stm32-dcmi: fix probe error path & module remove Hugues FRUCHET
2020-08-19 13:58   ` Hans Verkuil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1595918278-9724-3-git-send-email-alain.volmat@st.com \
    --to=alain.volmat@st.com \
    --cc=alexandre.torgue@st.com \
    --cc=hans.verkuil@cisco.com \
    --cc=hugues.fruchet@st.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mchehab@kernel.org \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=yannick.fertre@st.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®