Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755052AbbKQWyM (ORCPT ); Tue, 17 Nov 2015 17:54:12 -0500 Received: from violet.fr.zoreil.com ([92.243.8.30]:51936 "EHLO violet.fr.zoreil.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750867AbbKQWyL (ORCPT ); Tue, 17 Nov 2015 17:54:11 -0500 Date: Tue, 17 Nov 2015 23:54:03 +0100 From: Francois Romieu To: Ondrej Zary Cc: netdev@vger.kernel.org, David Miller , Kernel development list Subject: Re: [PATCH 1/3] dl2k: Handle memory allocation errors in alloc_list Message-ID: <20151117225403.GA3362@electric-eye.fr.zoreil.com> References: <1447781298-19785-1-git-send-email-linux@rainbow-software.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1447781298-19785-1-git-send-email-linux@rainbow-software.org> X-Organisation: Land of Sunshine Inc. User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 890 Lines: 24 Ondrej Zary : > 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 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/