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 via email to