Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1271717

Re: [PATCH 1/3] dl2k: Handle memory allocation errors in alloc_list

From Francois Romieu <romieu@fr.zoreil.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/3] dl2k: Handle memory allocation errors in alloc_list
Date 2015-11-18 00:00 +0100
Message-ID <qvXoe-2MS-11@gated-at.bofh.it> (permalink)
References <qvSeT-81H-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Ondrej Zary <linux@rainbow-software.org> :
> If memory allocation fails in alloc_list(), free the already allocated
> memory and return -ENODEV. In rio_open(), call alloc_list() first and
> abort if it fails. Move HW access (set RFDListPtr) out ot alloc_list().
> 
> Signed-off-by: Ondrej Zary <linux@rainbow-software.org>

ENODEV vs ENOMEM aside, it's ok with me.

The driver may avoid depleting the receive ring when netdev_alloc_skb_ip_align
fails in receive_packet (drop and increase stats->rx_dropped).

Then you may replace the pci_* dma helpers with the plain dma_* ones (they
can fail).

And perform a plain napi conversion.

-- 
Ueimor
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/3] dl2k: Handle memory allocation errors in alloc_list Ondrej Zary <linux@rainbow-software.org> - 2015-11-17 18:30 +0100
  [PATCH 2/3] dl2k: Reorder and cleanup initialization Ondrej Zary <linux@rainbow-software.org> - 2015-11-17 18:30 +0100
  Re: [PATCH 1/3] dl2k: Handle memory allocation errors in alloc_list Francois Romieu <romieu@fr.zoreil.com> - 2015-11-18 00:00 +0100
    Re: [PATCH 1/3] dl2k: Handle memory allocation errors in alloc_list Ondrej Zary <linux@rainbow-software.org> - 2015-11-18 09:20 +0100

csiph-web