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.


Cleanup based on cppcheck pass (Devices and Extensions)
[palacios.git] / palacios / src / devices / 8237_dma.c
index 40787a7..f131138 100644 (file)
@@ -33,9 +33,8 @@ static int dma_init(struct vm_device * dev) {
 
 
 
-static struct vm_device_ops dev_ops = {
-    .init = dma_init,
-    .deinit = NULL,
+static struct v3_device_ops dev_ops = {
+    .free = NULL,
     .reset = NULL,
     .start = NULL,
     .stop = NULL,
@@ -45,9 +44,13 @@ struct vm_device * v3_create_dma() {
     struct dma_state * dma = NULL;
 
     dma = (struct dma_state *)V3_Malloc(sizeof(struct dma_state));
-    V3_ASSERT(dma != NULL);
+
+    if (!dma) {
+       PrintError(info->vm_info, info, "Cannot allocate\n");
+       return NULL;
+    }
 
     struct vm_device * dev = v3_create_device("DMA", &dev_ops, dma);
 
-    return dma;
+    return dev;
 }