From b6cadfefabe1a029ed4188b67663820d27ba044e Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Tue, 17 Jun 2014 14:58:10 +0200 Subject: [PATCH] cache_mngr: Fix assignment of error code in nl_cache_mngr_alloc() In the current form, the parentheses in these two if (...) statements lead to err being assigned the result of nl_connect(...) < 0 and nl_socket_set_nonblocking(...) < 0 instead of the return value of these functions. Adjust the parentheses to assign the returned error code to err. Signed-off-by: Tobias Klauser Signed-off-by: Thomas Haller --- lib/cache_mngr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cache_mngr.c b/lib/cache_mngr.c index e24d44c..9b25e9b 100644 --- a/lib/cache_mngr.c +++ b/lib/cache_mngr.c @@ -165,10 +165,10 @@ int nl_cache_mngr_alloc(struct nl_sock *sk, int protocol, int flags, /* Required to receive async event notifications */ nl_socket_disable_seq_check(mngr->cm_sock); - if ((err = nl_connect(mngr->cm_sock, protocol) < 0)) + if ((err = nl_connect(mngr->cm_sock, protocol)) < 0) goto errout; - if ((err = nl_socket_set_nonblocking(mngr->cm_sock) < 0)) + if ((err = nl_socket_set_nonblocking(mngr->cm_sock)) < 0) goto errout; /* Create and allocate socket for sync cache fills */