From fec1c760ec6670c3b9efaa95c086fd78c89b404a Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 2 Aug 2019 09:09:45 +0200 Subject: [PATCH] device/adsl: restore brfd value on error in br2684_assign_vcc() Warned by coverity: we assert above that brfd is -1, so we must always restore it to -1 in the error case. Technically, not a problem because socket() is documented to return only -1 on error already. Apparently coverity does not believe that. (cherry picked from commit 5b9a848a82a756bfa01799a4f32d52af1490ec94) --- src/devices/adsl/nm-device-adsl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/devices/adsl/nm-device-adsl.c b/src/devices/adsl/nm-device-adsl.c index 59c87851d..536d7cccb 100644 --- a/src/devices/adsl/nm-device-adsl.c +++ b/src/devices/adsl/nm-device-adsl.c @@ -155,6 +155,7 @@ br2684_assign_vcc (NMDeviceAdsl *self, NMSettingAdsl *s_adsl) if (priv->brfd < 0) { errsv = errno; _LOGE (LOGD_ADSL, "failed to open ATM control socket (%d)", errsv); + priv->brfd = -1; return FALSE; }