3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-22 23:09:34 +01:00

client: add null check for adapter proxy

This commit is contained in:
Tim Kourt 2017-04-28 10:35:44 -07:00 committed by Denis Kenzior
parent 44e9e604f6
commit cd3d9a26c1

View File

@ -355,12 +355,19 @@ static bool device_unbind_interface(const struct proxy_interface *proxy,
static void display_device_inline(const char *margin, const void *data) static void display_device_inline(const char *margin, const void *data)
{ {
const struct device *device = data; const struct device *device = data;
const char *adapter_str;
if (device->adapter &&
proxy_interface_get_identity_str(device->adapter))
adapter_str = proxy_interface_get_identity_str(device->adapter);
else
adapter_str = "-";
display("%s%-*s%-*s%-*s%-*s%-*s\n", margin, display("%s%-*s%-*s%-*s%-*s%-*s\n", margin,
20, device->name ? : "", 20, device->name ? : "",
20, device->address ? : "", 20, device->address ? : "",
15, device->state ? : "", 15, device->state ? : "",
10, proxy_interface_get_identity_str(device->adapter) ? : "-", 10, adapter_str,
8, device->scanning ? "scanning" : ""); 8, device->scanning ? "scanning" : "");
} }