From: Greg KH <gregkh@linuxfoundation.org>
To: Dexuan Cui <decui@microsoft.com>
Cc: linux-kernel@vger.kernel.org,
driverdev-devel@linuxdriverproject.org, olaf@aepfle.de,
apw@canonical.com, jasowang@redhat.com, kys@microsoft.com,
vkuznets@redhat.com, dan.carpenter@oracle.com,
haiyangz@microsoft.com
Subject: Re: [PATCH] hv: vmbus_free_channels(): remove the redundant free_channel()
Date: Thu, 9 Apr 2015 11:07:06 +0200 [thread overview]
Message-ID: <20150409090706.GA28274@kroah.com> (raw)
In-Reply-To: <1428560027-31918-1-git-send-email-decui@microsoft.com>
On Wed, Apr 08, 2015 at 11:13:47PM -0700, Dexuan Cui wrote:
> free_channel() has been invoked in
> vmbus_remove() -> hv_process_channel_removal(), or vmbus_remove() ->
> ... -> vmbus_close_internal() -> hv_process_channel_removal().
>
> We also change to use list_for_each_entry_safe(), because the entry
> is removed in hv_process_channel_removal().
>
> Thank Dan Carpenter for finding the issue!
>
> Signed-off-by: Dexuan Cui <decui@microsoft.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Cc: K. Y. Srinivasan <kys@microsoft.com>
> Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
> ---
> drivers/hv/channel_mgmt.c | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
> index 0eeb1b3..865a3af 100644
> --- a/drivers/hv/channel_mgmt.c
> +++ b/drivers/hv/channel_mgmt.c
> @@ -212,11 +212,16 @@ void hv_process_channel_removal(struct vmbus_channel *channel, u32 relid)
>
> void vmbus_free_channels(void)
> {
> - struct vmbus_channel *channel;
> + struct vmbus_channel *channel, *tmp;
> +
> + list_for_each_entry_safe(channel, tmp, &vmbus_connection.chn_list,
> + listentry) {
Horrid indentation, never put continuations on a 1 tab stop location,
you can't read this properly, right?
> + /* if we don't set rescind to true, vmbus_close_internal()
> + * won't invoke hv_process_channel_removal().
> + */
> + channel->rescind = true;
You are changing the logic here, right? Why do you now need the _safe()
call if you aren't freeing anything?
confused,
greg k-h
next prev parent reply other threads:[~2015-04-09 9:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-09 6:13 [PATCH] hv: vmbus_free_channels(): remove the redundant free_channel() Dexuan Cui
2015-04-09 9:07 ` Greg KH [this message]
2015-04-09 9:15 ` Dexuan Cui
2015-04-09 9:21 ` Greg KH
2015-04-09 9:27 ` Dexuan Cui
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=20150409090706.GA28274@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=apw@canonical.com \
--cc=dan.carpenter@oracle.com \
--cc=decui@microsoft.com \
--cc=driverdev-devel@linuxdriverproject.org \
--cc=haiyangz@microsoft.com \
--cc=jasowang@redhat.com \
--cc=kys@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=olaf@aepfle.de \
--cc=vkuznets@redhat.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