From c9d8d9f37b62497a453047104b3e08d13f8bda81 Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Thu, 28 May 2015 10:43:00 +0000 Subject: [PATCH] i8255x: Fail graciously when out of mem. git-svn-id: svn://kolibrios.org@5561 a494cfbc-eb01-0410-851d-a64ba20cac60 --- drivers/ethernet/i8255x.asm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/ethernet/i8255x.asm b/drivers/ethernet/i8255x.asm index 332d8bb53..2b34d1364 100644 --- a/drivers/ethernet/i8255x.asm +++ b/drivers/ethernet/i8255x.asm @@ -822,6 +822,8 @@ int_handler: ; allocate new descriptor invoke NetAlloc, 2000 + test eax, eax + jz .out_of_mem mov [ebx + device.rx_desc], eax mov esi, eax invoke GetPhysAddr @@ -845,6 +847,7 @@ int_handler: mov ax, RX_START out dx, ax call cmd_wait + .out_of_mem: ; And give packet to kernel jmp [EthInput]