summaryrefslogtreecommitdiffstats
path: root/python-ethtool/netlink.c
diff options
context:
space:
mode:
authorDavid Sommerseth <davids@redhat.com>2014-01-10 17:57:05 +0100
committerDavid Sommerseth <davids@redhat.com>2014-01-10 17:57:05 +0100
commitb15cd540acf49a283d30c28e1424230e51440772 (patch)
tree06db6e36d61ac4800acfb2a1e99a99f665514393 /python-ethtool/netlink.c
parente52b6636a9c9850cf6e908e647a600a144d21da4 (diff)
downloadpython-ethtool-b15cd540acf49a283d30c28e1424230e51440772.tar.gz
python-ethtool-b15cd540acf49a283d30c28e1424230e51440772.tar.xz
python-ethtool-b15cd540acf49a283d30c28e1424230e51440772.zip
Added some extra error checks with libnl calls
Signed-off-by: David Sommerseth <davids@redhat.com>
Diffstat (limited to 'python-ethtool/netlink.c')
-rw-r--r--python-ethtool/netlink.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/python-ethtool/netlink.c b/python-ethtool/netlink.c
index 9ba8338..d311405 100644
--- a/python-ethtool/netlink.c
+++ b/python-ethtool/netlink.c
@@ -57,8 +57,8 @@ int open_netlink(PyEtherInfo *ethi)
/* No earlier connections exists, establish a new one */
nlconnection = nl_socket_alloc();
- nl_connect(nlconnection, NETLINK_ROUTE);
- if( (nlconnection != NULL) ) {
+ if( nlconnection != NULL ) {
+ nl_connect(nlconnection, NETLINK_ROUTE);
/* Force O_CLOEXEC flag on the NETLINK socket */
if( fcntl(nl_socket_get_fd(nlconnection), F_SETFD, FD_CLOEXEC) == -1 ) {
fprintf(stderr,