From 061ad8c5e8209f5bda3866cbe3ddf6b639d2110c Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Wed, 19 Jul 2017 09:14:56 +0100 Subject: [PATCH] trivial: Make fu_dell_detect_dock() slightly more NULL-deref safe --- plugins/dell/fu-dell-common.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/dell/fu-dell-common.c b/plugins/dell/fu-dell-common.c index 4b8366b28..71994c586 100644 --- a/plugins/dell/fu-dell-common.c +++ b/plugins/dell/fu-dell-common.c @@ -159,9 +159,10 @@ fu_dell_detect_dock (FuDellSmiObj *smi_obj, guint32 *location) g_debug ("no dock plugged in"); return FALSE; } - *location = count_out->location; g_debug ("Dock count %u, location %u.", - count_out->count, *location); + count_out->count, count_out->location); + if (location != NULL) + *location = count_out->location; return TRUE; }