public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Hans Verkuil <hverkuil@xs4all.nl>,
	Deborah Brouwer <deborahbrouwer3563@gmail.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] media: vivid: fix an error code in vivid_create_instance()
Date: Tue, 21 Sep 2021 23:39:44 +0300	[thread overview]
Message-ID: <20210921203944.GD16529@kili> (raw)

Preserve the error code stored in "dev->kthread_cec" before setting it
to NULL.

Fixes: 439e520995ab ("media: vivid: add signal-free time for cec message xfer")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/media/test-drivers/vivid/vivid-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/test-drivers/vivid/vivid-core.c b/drivers/media/test-drivers/vivid/vivid-core.c
index bcf03bea1e3c..04b75666bad4 100644
--- a/drivers/media/test-drivers/vivid/vivid-core.c
+++ b/drivers/media/test-drivers/vivid/vivid-core.c
@@ -1934,9 +1934,9 @@ static int vivid_create_instance(struct platform_device *pdev, int inst)
 		dev->kthread_cec = kthread_run(vivid_cec_bus_thread, dev,
 					       "vivid_cec-%s", dev->v4l2_dev.name);
 		if (IS_ERR(dev->kthread_cec)) {
+			ret = PTR_ERR(dev->kthread_cec);
 			dev->kthread_cec = NULL;
 			v4l2_err(&dev->v4l2_dev, "kernel_thread() failed\n");
-			ret = PTR_ERR(dev->kthread_cec);
 			goto unreg_dev;
 		}
 	}
-- 
2.20.1


                 reply	other threads:[~2021-09-21 20:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20210921203944.GD16529@kili \
    --to=dan.carpenter@oracle.com \
    --cc=deborahbrouwer3563@gmail.com \
    --cc=hverkuil@xs4all.nl \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    /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