raw/cnxk_bphy: fix device lookup

Name needs to be prepared before the lookup otherwise
PMD will not be released.

Fixes: 24d9c5d59d5d ("raw/cnxk_bphy: add baseband PHY skeleton driver")
Cc: stable@dpdk.org

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
This commit is contained in:
Tomasz Duszynski 2021-08-16 01:12:00 +02:00 committed by Jerin Jacob
parent 11bb961c01
commit f282af588a

View File

@ -307,14 +307,13 @@ bphy_rawdev_remove(struct rte_pci_device *pci_dev)
return -EINVAL;
}
bphy_rawdev_get_name(name, pci_dev);
rawdev = rte_rawdev_pmd_get_named_dev(name);
if (rawdev == NULL) {
plt_err("invalid device name (%s)", name);
return -EINVAL;
}
bphy_rawdev_get_name(name, pci_dev);
return rte_rawdev_pmd_release(rawdev);
}