[v4,5/5] bus/vdev: check result of rte_vdev_device_name
Checks
Commit Message
From: Sinan Kaya <okaya@kernel.org>
In rte_eth_vdev_allocate result of call to rte_vdev_device_name is
dereferenced here and may be null.
Signed-off-by: Sinan Kaya <okaya@kernel.org>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/ethdev/ethdev_vdev.h | 2 ++
1 file changed, 2 insertions(+)
Comments
On 7/10/23 20:08, Stephen Hemminger wrote:
> From: Sinan Kaya <okaya@kernel.org>
>
> In rte_eth_vdev_allocate result of call to rte_vdev_device_name is
> dereferenced here and may be null.
>
> Signed-off-by: Sinan Kaya <okaya@kernel.org>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Patch summary should be human-readable and do not mention
internals (function name).
Other than that:
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
@@ -34,6 +34,8 @@ rte_eth_vdev_allocate(struct rte_vdev_device *dev, size_t private_data_size)
{
struct rte_eth_dev *eth_dev;
const char *name = rte_vdev_device_name(dev);
+ if (name == NULL)
+ return NULL;
eth_dev = rte_eth_dev_allocate(name);
if (!eth_dev)