diff --git a/src/config.c b/src/config.c
index aaa8cd9ab54bea0074659d5e20d8362773afbe46..19087d12b64d599669e06634476b65b767604fb8 100644
--- a/src/config.c
+++ b/src/config.c
@@ -213,11 +213,11 @@ char *agent_get_controller_enabled(struct agent *a, char *buf)
 {
 	struct uci_context *ctx;
 	struct uci_ptr ptr = {0};
-	int ret = -1;
+	int ret;
 
 	ctx = uci_alloc_context();
 	if (!ctx)
-		return -1;
+		return NULL;
 
 	ptr.package = "mapcontroller";
 	ptr.section = "controller";
@@ -237,7 +237,7 @@ char *agent_get_controller_enabled(struct agent *a, char *buf)
 	uci_unload(ctx, ptr.p);
 error:
 	uci_free_context(ctx);
-	return ret;
+	return buf;
 }