DPDK patches and discussions
 help / color / mirror / Atom feed
From: Yuanhan Liu <yuanhan.liu@linux.intel.com>
To: Jianfeng Tan <jianfeng.tan@intel.com>
Cc: dev@dpdk.org, john.mcnamara@intel.com
Subject: Re: [dpdk-dev] [PATCH] net/virtio-user: check value returned from malloc
Date: Sat, 28 Jan 2017 21:26:21 +0800	[thread overview]
Message-ID: <20170128132621.GB20916@yliu-dev.sh.intel.com> (raw)
In-Reply-To: <1485399942-94705-1-git-send-email-jianfeng.tan@intel.com>

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 *
>     prepare_vhost_memory_kernel(void)
>     {
>         ...
>         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@intel.com>

Applied to dpdk-next-virtio.

	--yliu

      reply	other threads:[~2017-01-28 13:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-26  3:05 Jianfeng Tan
2017-01-28 13:26 ` Yuanhan Liu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170128132621.GB20916@yliu-dev.sh.intel.com \
    --to=yuanhan.liu@linux.intel.com \
    --cc=dev@dpdk.org \
    --cc=jianfeng.tan@intel.com \
    --cc=john.mcnamara@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).