cap_delete_last: Handle LMP buffer overflow more gracefully.
authorSimon Gerber <simon.gerber@inf.ethz.ch>
Mon, 12 Jan 2015 16:14:56 +0000 (17:14 +0100)
committerSimon Gerber <simon.gerber@inf.ethz.ch>
Mon, 12 Jan 2015 16:32:33 +0000 (17:32 +0100)
kernel/cap_delete.c

index 364e3dc..4dea0d3 100644 (file)
@@ -285,7 +285,13 @@ cleanup_last(struct cte *cte, struct cte *ret_ram_cap)
         else {
             printk(LOG_WARN, "dropping ram cap base %08"PRIxGENPADDR" bits %"PRIu8"\n", ram.base, ram.bits);
         }
-        assert(err_is_ok(err));
+        if (err_no(err) == SYS_ERR_LMP_BUF_OVERFLOW) {
+            printk(LOG_WARN, "dropped ram cap base %08"PRIxGENPADDR" bits %"PRIu8"\n", ram.base, ram.bits);
+            err = SYS_ERR_OK;
+
+        } else {
+            assert(err_is_ok(err));
+        }
     }
 
     return err;