From: Коренберг Марк Date: Thu, 30 Aug 2012 16:53:19 +0000 (+0600) Subject: genl_ctrl_probe_by_name: fix checking of genlmsg_put() return value X-Git-Tag: libnl3_2_13~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=49c94c3490fe2691293a8d45b3dab574ee73ca31;p=libnl genl_ctrl_probe_by_name: fix checking of genlmsg_put() return value It's a pointer! not an error code :) nasty bugs --- diff --git a/lib/genl/ctrl.c b/lib/genl/ctrl.c index 5950394..057a1bf 100644 --- a/lib/genl/ctrl.c +++ b/lib/genl/ctrl.c @@ -255,8 +255,8 @@ static struct genl_family *genl_ctrl_probe_by_name(struct nl_sock *sk, if (!(cb = nl_cb_clone(nl_socket_get_cb(sk)))) goto out_msg_free; - if (genlmsg_put(msg, NL_AUTO_PORT, NL_AUTO_SEQ, GENL_ID_CTRL, - 0, 0, CTRL_CMD_GETFAMILY, 1) < 0) { + if (!genlmsg_put(msg, NL_AUTO_PORT, NL_AUTO_SEQ, GENL_ID_CTRL, + 0, 0, CTRL_CMD_GETFAMILY, 1)) { BUG(); goto out_cb_free; }