[dpdk-dev] [PATCH] net/virtio-user: check value returned from malloc
yuanhan.liu at linux.intel.com
Sat Jan 28 14:26:21 CET 2017
On Thu, Jan 26, 2017 at 03:05:42AM +0000, Jianfeng Tan wrote:
> Value returned from malloc is not checked for errors before being used.
> This patch fixes following coverity issue.
> static struct vhost_memory_kernel *
> vm = malloc(sizeof(struct vhost_memory_kernel) +
> max_regions *
> sizeof(struct vhost_memory_region));
> >>> CID 140744: (NULL_RETURNS)
> >>> Dereferencing a null pointer "vm".
> mr = &vm->regions[k++];
> Fixes: e3b434818bbb ("net/virtio-user: support kernel vhost")
> Coverity issue: 140744
> Signed-off-by: Jianfeng Tan <jianfeng.tan at intel.com>
Applied to dpdk-next-virtio.
More information about the dev