Blame SOURCES/0022-rh1112020-crash-reading-bridge-sysctl.patch

69d374
From db81083ac2d8feb84d08e1c16ef285243fee7977 Mon Sep 17 00:00:00 2001
69d374
From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= <jklimes@redhat.com>
69d374
Date: Fri, 6 Jun 2014 18:22:06 +0200
69d374
Subject: [PATCH 1/1] device: don't call strtol() for NULL strings
69d374
69d374
 #1  0x0000003c47239ea2 in __GI_strtol (nptr=nptr@entry=0x0, endptr=endptr@entry=0x0, base=base@entry=10) at ../stdlib/strtol.c:110
69d374
 #2  0x000000000043b896 in update_connection (device=<optimized out>, connection=<optimized out>) at devices/nm-device-bridge.c:308
69d374
 #3  0x000000000042ed2f in nm_device_generate_connection (device=device@entry=0xfbb260 [NMDeviceBridge]) at devices/nm-device.c:1644
69d374
 #4  0x0000000000481613 in get_existing_connection (device=0xfbb260 [NMDeviceBridge], manager=0xfb2000 [NMManager]) at nm-manager.c:1549
69d374
 #5  add_device (self=self@entry=0xfb2000 [NMManager], device=device@entry=0xfbb260 [NMDeviceBridge], generate_con=<optimized out>)
69d374
     at nm-manager.c:1688
69d374
 #6  0x0000000000481f50 in platform_link_added (plink=0x7fffffffdd50, ifindex=695, self=0xfb2000 [NMManager], reason=<optimized out>)
69d374
     at nm-manager.c:2023
69d374
 #7  platform_link_cb (platform=<optimized out>, ifindex=695, plink=0x7fffffffdd50, change_type=<optimized out>, reason=<optimized out>,
69d374
     user_data=<optimized out>) at nm-manager.c:2038
69d374
69d374
(cherry picked from commit 3ef79ee2492475b213bcdf070a1f7207d4e58b64)
69d374
---
69d374
 src/devices/nm-device-bridge.c | 17 ++++++++++++-----
69d374
 1 file changed, 12 insertions(+), 5 deletions(-)
69d374
69d374
diff --git a/src/devices/nm-device-bridge.c b/src/devices/nm-device-bridge.c
69d374
index 92cc9f2..2e6a393 100644
69d374
--- a/src/devices/nm-device-bridge.c
69d374
+++ b/src/devices/nm-device-bridge.c
69d374
@@ -300,13 +300,20 @@ update_connection (NMDevice *device, NMConnection *connection)
69d374
 
69d374
 	for (option = master_options; option->name; option++) {
69d374
 		gs_free char *str = nm_platform_master_get_option (ifindex, option->sysname);
69d374
-		int value = strtol (str, NULL, 10);
69d374
+		int value;
69d374
 
69d374
-		/* See comments in set_sysfs_uint() about centiseconds. */
69d374
-		if (option->user_hz_compensate)
69d374
-			value /= 100;
69d374
+		if (str) {
69d374
+			value = strtol (str, NULL, 10);
69d374
+
69d374
+			/* See comments in set_sysfs_uint() about centiseconds. */
69d374
+			if (option->user_hz_compensate)
69d374
+				value /= 100;
69d374
 
69d374
-		g_object_set (s_bridge, option->name, value, NULL);
69d374
+			g_object_set (s_bridge, option->name, value, NULL);
69d374
+		} else {
69d374
+			nm_log_warn (LOGD_BRIDGE, "(%s): failed to read bridge setting '%s'",
69d374
+			             nm_device_get_iface (device), option->sysname);
69d374
+		}
69d374
 	}
69d374
 }
69d374
 
69d374
-- 
69d374
1.9.3
69d374