vhost: fix potential null pointer dereference
authorYuanhan Liu <yuanhan.liu@linux.intel.com>
Tue, 28 Jun 2016 03:58:31 +0000 (11:58 +0800)
committerYuanhan Liu <yuanhan.liu@linux.intel.com>
Mon, 4 Jul 2016 02:08:41 +0000 (04:08 +0200)
commit9d8365874e37ca118dab03bf63ec7400b33d5948
tree9cc0d4748e0f5e10af37a2d9b1269d839542e66c
parentf80c3fd3b4387dc89d378b3903d4cf9711660dc3
vhost: fix potential null pointer dereference

Fix the potential NULL pointer dereference issue raised by Coverity.

    578             reconn = malloc(sizeof(*reconn));
    >>>     CID 127481:  Null pointer dereferences  (NULL_RETURNS)
    >>>     Dereferencing a null pointer "reconn".
    579             reconn->un = un;

Coverity issue: 127481
Fixes: e623e0c6d8a5 ("vhost: add reconnect ability")

Reported-by: John McNamara <john.mcnamara@intel.com>
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
lib/librte_vhost/vhost_user/vhost-net-user.c