/* Alloc memory for the lookup table */
        rx_ring->fbr[0] = kmalloc(sizeof(struct fbr_lookup), GFP_KERNEL);
+       if (rx_ring->fbr[0] == NULL)
+               return -ENOMEM;
        rx_ring->fbr[1] = kmalloc(sizeof(struct fbr_lookup), GFP_KERNEL);
+       if (rx_ring->fbr[1] == NULL)
+               return -ENOMEM;
 
        /* The first thing we will do is configure the sizes of the buffer
         * rings. These will change based on jumbo packet support.  Larger
        for (id = 0; id < NUM_FBRS; id++) {
                fbr = rx_ring->fbr[id];
 
-               if (!fbr->ring_virtaddr)
+               if (!fbr || !fbr->ring_virtaddr)
                        continue;
 
                /* First the packet memory */
        if (status) {
                dev_err(&adapter->pdev->dev,
                          "et131x_tx_dma_memory_alloc FAILED\n");
+               et131x_tx_dma_memory_free(adapter);
                return status;
        }
        /* Receive buffer memory allocation */
        if (status) {
                dev_err(&adapter->pdev->dev,
                          "et131x_rx_dma_memory_alloc FAILED\n");
-               et131x_tx_dma_memory_free(adapter);
+               et131x_adapter_memory_free(adapter);
                return status;
        }