提交 d69b79ab 编写于 作者: E Eric Blake

interface: drop dead code

Coverity detected that ifaceGetNthParent had already dereferenced
'nth' prior to the conditional; all callers already complied with
passing a non-NULL pointer so make this part of the contract.

* src/util/interface.h (ifaceGetNthParent): Add annotations.
* src/util/interface.c (ifaceGetNthParent): Drop useless null check.
上级 0634b623
......@@ -1060,7 +1060,6 @@ ifaceGetNthParent(int ifindex, const char *ifname, unsigned int nthParent,
i++;
}
if (nth)
*nth = i - 1;
return rc;
......
/*
* interface.h: interface helper APIs for libvirt
*
* Copyright (C) 2011 Red Hat, Inc.
* Copyright (C) 2010 IBM Corporation, Inc.
*
* See COPYING.LIB for the License of this software
......@@ -67,7 +68,9 @@ int ifaceMacvtapLinkDump(bool nltarget_kernel, const char *ifname, int ifindex,
int ifaceGetNthParent(int ifindex, const char *ifname, unsigned int nthParent,
int *parent_ifindex, char *parent_ifname,
unsigned int *nth);
unsigned int *nth)
ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5)
ATTRIBUTE_NONNULL(6);
int ifaceReplaceMacAddress(const unsigned char *macaddress,
const char *linkdev,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册