Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Lots of pedantic error checking in Palacios proper, especially for memory
[palacios.git] / palacios / src / palacios / vmm_queue.c
index 20fa255..28d41ac 100644 (file)
@@ -27,6 +27,12 @@ void v3_init_queue(struct v3_queue * queue) {
 
 struct v3_queue * v3_create_queue() {
     struct v3_queue * tmp_queue = V3_Malloc(sizeof(struct v3_queue));
+
+    if (!tmp_queue) {
+       PrintError("Cannot allocate a queue\n");
+       return NULL;
+    }
+
     v3_init_queue(tmp_queue);
     return tmp_queue;
 }
@@ -35,6 +41,11 @@ void v3_enqueue(struct v3_queue * queue, addr_t entry) {
     struct v3_queue_entry * q_entry = V3_Malloc(sizeof(struct v3_queue_entry));
     unsigned int flags = 0;
 
+    if (!q_entry) {
+       PrintError("Cannot allocate a queue entry for enqueue\n");
+       return ;
+    }
+
     flags = v3_lock_irqsave(queue->lock);
     q_entry->entry = entry;
     list_add_tail(&(q_entry->entry_list), &(queue->entries));