diff options
| author | Xiong Weimin <xiongweimin@kylinos.cn> | 2026-08-04 17:26:36 +0800 |
|---|---|---|
| committer | Michael S. Tsirkin <mst@redhat.com> | 2026-09-07 18:54:03 -0400 |
| commit | 6519ca235131c3281a83cc9e8b05af709ab98a89 (patch) | |
| tree | 0ae3baa5e8a87595742fb82e8c65628e108af05d | |
| parent | 4d470be71196ca0ce302e6623454533dc31b465b (diff) | |
vdpa: octeon_ep: Check dev_set_name() in dev add
Handle dev_set_name() failures before registering the vDPA device so
allocation is unwound through the existing put_device() path.
Signed-off-by: Xiong Weimin <xiongweimin@kylinos.cn>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20260804092636.1344431-1-xiongweimin@kylinos.cn>
| -rw-r--r-- | drivers/vdpa/octeon_ep/octep_vdpa_main.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/vdpa/octeon_ep/octep_vdpa_main.c b/drivers/vdpa/octeon_ep/octep_vdpa_main.c index 23e280a29209..85a3d35ea1e4 100644 --- a/drivers/vdpa/octeon_ep/octep_vdpa_main.c +++ b/drivers/vdpa/octeon_ep/octep_vdpa_main.c @@ -600,6 +600,8 @@ static int octep_vdpa_dev_add(struct vdpa_mgmt_dev *mdev, const char *name, ret = dev_set_name(&vdpa_dev->dev, "%s", name); else ret = dev_set_name(&vdpa_dev->dev, "vdpa%u", vdpa_dev->index); + if (ret) + goto vdpa_dev_put; ret = _vdpa_register_device(&oct_vdpa->vdpa, oct_hw->nr_vring); if (ret) { |
