Re: [PATCH] vdpa: ifcvf: Put device on unsupported feature error

"Michael S. Tsirkin" <[email protected]>
Newsgroups org.kernel.vger.linux-kernel,dev.linux.lists.virtualization
Message-ID <[email protected]>
On Tue, Aug 04, 2026 at 05:26:26PM +0800, Xiong Weimin wrote:
> Route unsupported provisioned features through the common error path after
> vdpa_alloc_device() so the allocated device and adapter pointer are
> released consistently.
> 
> Signed-off-by: Xiong Weimin <[email protected]>


I have no idea what this means. This is not how a commit log should
look. An example template:

Currently .... This is a problem because ... We can not do .... because
... To address .... And then ....



> ---
>  drivers/vdpa/ifcvf/ifcvf_main.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c b/drivers/vdpa/ifcvf/ifcvf_main.c
> index ab6d6ab3b..3cd2c35db 100644
> --- a/drivers/vdpa/ifcvf/ifcvf_main.c
> +++ b/drivers/vdpa/ifcvf/ifcvf_main.c
> @@ -724,7 +724,8 @@ static int ifcvf_vdpa_dev_add(struct vdpa_mgmt_dev *mdev, const char *name,
>  		if (config->device_features & ~device_features) {
>  			IFCVF_ERR(pdev, "The provisioned features 0x%llx are not supported by this device with features 0x%llx\n",
>  				  config->device_features, device_features);
> -			return -EINVAL;
> +			ret = -EINVAL;
> +			goto err;
>  		}
>  		device_features &= config->device_features;
>  	}
> @@ -748,6 +749,7 @@ static int ifcvf_vdpa_dev_add(struct vdpa_mgmt_dev *mdev, const char *name,
>  	return 0;
>  
>  err:
> +	ifcvf_mgmt_dev->adapter = NULL;
>  	put_device(&adapter->vdpa.dev);
>  	return ret;
>  }
> -- 
> 2.43.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.