net/interface: check socket() return value

Change-Id: I3abd1d2c98cda10acfb85abc221e294563843c07
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Daniel Verkamp 2017-02-10 10:35:07 -07:00 committed by Jim Harris
parent 7912aa4a17
commit a9de0d5f69

View File

@ -345,6 +345,10 @@ static int netlink_addr_msg(uint32_t ifc_idx, uint32_t ip_address, uint32_t crea
return -1;
fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
if (fd < 0) {
SPDK_ERRLOG("socket failed!\n");
return -1;
}
/* setup local address & bind using this address. */
bzero(&la, sizeof(la));