[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/3] virtio pmem: remove memdev null check
From: |
Cornelia Huck |
Subject: |
Re: [Qemu-devel] [PATCH 2/3] virtio pmem: remove memdev null check |
Date: |
Fri, 12 Jul 2019 12:01:39 +0200 |
On Fri, 12 Jul 2019 13:05:53 +0530
Pankaj Gupta <address@hidden> wrote:
> Coverity reports that when we're assigning vi->size we handle the
> "pmem->memdev is NULL" case; but we then pass it into
> object_get_canonical_path(), which unconditionally dereferences it
> and will crash if it is NULL. If this pointer can be NULL then we
> need to do something else here.
>
> We are removing 'pmem->memdev' null check here as memdev will never
> be null in this function.
Indeed, we'll fail to realize the device if it is NULL.
>
> Signed-off-by: Pankaj Gupta <address@hidden>
> ---
> hw/virtio/virtio-pmem.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Cornelia Huck <address@hidden>