diff --git a/gck-rpc-module.c b/gck-rpc-module.c
index 1afe9503e535589104031d1fe7d7d60ca70d2502..1c6c6dec858d941970be505bf72859cbe97bd0c7 100644
--- a/gck-rpc-module.c
+++ b/gck-rpc-module.c
@@ -1258,6 +1258,9 @@ static CK_RV rpc_C_Initialize(CK_VOID_PTR init_args)
 					 sizeof(pkcs11_socket_path),
 					 "%s.pkcs11", path);
 			pkcs11_socket_path[sizeof(pkcs11_socket_path) - 1] = 0;
+		} else {
+			ret =  CKR_FUNCTION_NOT_SUPPORTED;
+			goto done;
 		}
 	}