diff --git a/src/libcamera/egl.cpp b/src/libcamera/egl.cpp
index 237791bca1..edb00ef997 100644
--- a/src/libcamera/egl.cpp
+++ b/src/libcamera/egl.cpp
@@ -357,7 +357,7 @@ void eGL::createOutputTexture2D(eGLImage &eglImage)
  * - eglCreateImageKHR / eglDestroyImageKHR
  * - glEGLImageTargetTexture2DOES
  *
- * \return 0 on success, or -ENODEV on failure
+ * \return 0 on success, or negative error code on failure
  */
 int eGL::initEGLContext()
 {
@@ -380,6 +380,9 @@ int eGL::initEGLContext()
 	EGLint numConfigs;
 	EGLConfig config;
 
+	if (context_ != EGL_NO_CONTEXT)
+		return -EEXIST;
+
 	if (!eglBindAPI(EGL_OPENGL_ES_API)) {
 		LOG(eGL, Error) << "API bind fail";
 		goto fail;
