mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kameron Carr <kameroncarr@linux.microsoft.com>
To: Jiale Yao <yaojiale02@163.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>, Dexuan Cui <decui@microsoft.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Stephen Hemminger <stephen@networkplumber.org>,
	linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] Drivers: hv: vmbus: copy dynamic IDs before dropping the lock
Date: Fri, 23 Oct 2026 17:41:17 -0700	[thread overview]
Message-ID: <d04125b1-1228-4322-a455-3b8970167239@linux.microsoft.com> (raw)
In-Reply-To: <20261021143323.338146-3-yaojiale02@163.com>

On 10/21/2026 7:33 AM, Jiale Yao wrote:
[...]
> @@ -860,13 +862,17 @@ static int vmbus_match(struct device *device, const struct device_driver *driver
>   */
>  static int vmbus_probe(struct device *child_device)
>  {
> -	int ret = 0;
> +	const struct hv_vmbus_device_id *dev_id;
> +	struct hv_vmbus_device_id dev_id_copy;
>  	struct hv_driver *drv =
>  			drv_to_hv_drv(child_device->driver);
>  	struct hv_device *dev = device_to_hv_device(child_device);
> -	const struct hv_vmbus_device_id *dev_id;
> +	int ret = 0;

Nit: the reordering of these declarations is unnecessary.
In a stable patch, we shouldn't include any purely style changes.

-- 
Regards,
Kameron

> +
> +	dev_id = hv_vmbus_get_id(drv, dev, &dev_id_copy);
> +	if (!dev_id && !is_hvsock_channel(dev->channel))
> +		return -ENODEV;
>  
> -	dev_id = hv_vmbus_get_id(drv, dev);
>  	if (drv->probe) {
>  		ret = drv->probe(dev, dev_id);
>  		if (ret != 0)
> diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
> index 9e109d91aa14..0f0423e8a184 100644
> --- a/include/linux/hyperv.h
> +++ b/include/linux/hyperv.h
> @@ -1264,6 +1264,7 @@ struct hv_driver {
>  		struct list_head list;
>  	} dynids;
>  
> +	/* The device ID pointer is only valid during the probe callback. */
>  	int (*probe)(struct hv_device *, const struct hv_vmbus_device_id *);
>  	void (*remove)(struct hv_device *dev);
>  	void (*shutdown)(struct hv_device *);




  reply	other threads:[~2026-10-24  0:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-21 14:33 [PATCH v2 0/2] Drivers: hv: vmbus: fix dynamic ID races Jiale Yao
2026-10-21 14:33 ` [PATCH v2 1/2] Drivers: hv: vmbus: prevent duplicate dynamic IDs Jiale Yao
2026-10-21 14:33 ` [PATCH v2 2/2] Drivers: hv: vmbus: copy dynamic IDs before dropping the lock Jiale Yao
2026-10-24  0:41   ` Kameron Carr [this message]
2026-10-24  0:42 ` [PATCH v2 0/2] Drivers: hv: vmbus: fix dynamic ID races Kameron Carr

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=d04125b1-1228-4322-a455-3b8970167239@linux.microsoft.com \
    --to=kameroncarr@linux.microsoft.com \
    --cc=decui@microsoft.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=haiyangz@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    --cc=wei.liu@kernel.org \
    --cc=yaojiale02@163.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®