mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lv Yunlong <lyl2019@mail.ustc.edu.cn>
To: johan@kernel.org, elder@kernel.org, gregkh@linuxfoundation.org
Cc: greybus-dev@lists.linaro.org, linux-kernel@vger.kernel.org,
	Lv Yunlong <lyl2019@mail.ustc.edu.cn>
Subject: [PATCH] greybus/operation: Drop reference when message has been set
Date: Wed, 10 Mar 2021 01:10:14 -0800	[thread overview]
Message-ID: <20210310091014.6407-1-lyl2019@mail.ustc.edu.cn> (raw)

In gb_operation_response_send, get an extra reference
before gb_message_send() with this comment "/* Reference will
be dropped when message has been sent. */". Therefore, we
should drop the got reference not only in the error branch,
but also in the complete branch.

Signed-off-by: Lv Yunlong <lyl2019@mail.ustc.edu.cn>
---
 drivers/greybus/operation.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/greybus/operation.c b/drivers/greybus/operation.c
index 296f0b93d171..500b3fe53a04 100644
--- a/drivers/greybus/operation.c
+++ b/drivers/greybus/operation.c
@@ -855,7 +855,7 @@ static int gb_operation_response_send(struct gb_operation *operation,
 	if (ret)
 		goto err_put_active;
 
-	/*Drop reference after message send successfully. */
+	/*Drop reference after message send completes. */
 	gb_operation_put_active(operation);
 	gb_operation_put(operation);
 
-- 
2.25.1



             reply	other threads:[~2021-03-10  9:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-10  9:10 Lv Yunlong [this message]
2021-03-10  9:32 ` Greg KH
2021-03-10 14:07   ` lyl2019

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=20210310091014.6407-1-lyl2019@mail.ustc.edu.cn \
    --to=lyl2019@mail.ustc.edu.cn \
    --cc=elder@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=greybus-dev@lists.linaro.org \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.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

all inboxes | Powered by JetHome®