vhost: fix null pointer dereference
Checks
Commit Message
Fixes: 155ee3542fb1 ("vhost: improve vhost-user layer logs")
Signed-off-by: Weiguo Li <liwg06@foxmail.com>
---
lib/vhost/vhost_user.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 1/29/22 20:07, Weiguo Li wrote:
> Fixes: 155ee3542fb1 ("vhost: improve vhost-user layer logs")
>
> Signed-off-by: Weiguo Li <liwg06@foxmail.com>
> ---
> lib/vhost/vhost_user.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c
> index e8297a09eb..d032998488 100644
> --- a/lib/vhost/vhost_user.c
> +++ b/lib/vhost/vhost_user.c
> @@ -671,7 +671,7 @@ numa_realloc(struct virtio_net *dev, int index)
> dev = rte_realloc_socket(old_dev, sizeof(*dev), 0, node);
> if (!dev) {
> VHOST_LOG_CONFIG(ERR, "(%s) failed to realloc dev on node %d\n",
> - dev->ifname, node);
> + old_dev->ifname, node);
> return old_dev;
> }
>
Thanks for the fix.
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Thanks,
Maxime
On 1/29/22 20:07, Weiguo Li wrote:
> Fixes: 155ee3542fb1 ("vhost: improve vhost-user layer logs")
>
> Signed-off-by: Weiguo Li <liwg06@foxmail.com>
> ---
> lib/vhost/vhost_user.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c
> index e8297a09eb..d032998488 100644
> --- a/lib/vhost/vhost_user.c
> +++ b/lib/vhost/vhost_user.c
> @@ -671,7 +671,7 @@ numa_realloc(struct virtio_net *dev, int index)
> dev = rte_realloc_socket(old_dev, sizeof(*dev), 0, node);
> if (!dev) {
> VHOST_LOG_CONFIG(ERR, "(%s) failed to realloc dev on node %d\n",
> - dev->ifname, node);
> + old_dev->ifname, node);
> return old_dev;
> }
>
Applied to dpdk-next-virtio/main.
Thanks,
Maxime
@@ -671,7 +671,7 @@ numa_realloc(struct virtio_net *dev, int index)
dev = rte_realloc_socket(old_dev, sizeof(*dev), 0, node);
if (!dev) {
VHOST_LOG_CONFIG(ERR, "(%s) failed to realloc dev on node %d\n",
- dev->ifname, node);
+ old_dev->ifname, node);
return old_dev;
}