diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h
index 49ff1a6f747f..a5a6a135ec16 100644
--- a/include/libcamera/controls.h
+++ b/include/libcamera/controls.h
@@ -54,11 +54,11 @@ class ControlId
 {
 public:
 	unsigned int id() const { return id_; }
-	const char *name() const { return name_; }
+	const std::string &name() const { return name_; }
 	ControlType type() const { return type_; }
 
 protected:
-	ControlId(unsigned int id, const char *name, ControlType type)
+	ControlId(unsigned int id, const std::string &name, ControlType type)
 		: id_(id), name_(name), type_(type)
 	{
 	}
@@ -68,7 +68,7 @@ private:
 	ControlId &operator=(const ControlId &) = delete;
 
 	unsigned int id_;
-	const char *name_;
+	std::string name_;
 	ControlType type_;
 };
 
diff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp
index f862a09adef9..e528dd80a2a7 100644
--- a/src/libcamera/controls.cpp
+++ b/src/libcamera/controls.cpp
@@ -205,7 +205,7 @@ std::string ControlValue::toString() const
  */
 
 /**
- * \fn ControlId::ControlId(unsigned int id, const char *name, ControlType type)
+ * \fn ControlId::ControlId(unsigned int id, const std::string &name, ControlType type)
  * \brief Construct a ControlId instance
  * \param[in] id The control numerical ID
  * \param[in] name The control name
