From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756018AbbDGOY4 (ORCPT ); Tue, 7 Apr 2015 10:24:56 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:35389 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754789AbbDGOYv (ORCPT ); Tue, 7 Apr 2015 10:24:51 -0400 Date: Tue, 7 Apr 2015 19:54:44 +0530 From: Sudip Mukherjee To: Giedrius =?utf-8?Q?Statkevi=C4=8Dius?= Cc: lidza.louina@gmail.com, markh@compro.net, gregkh@linuxfoundation.org, driverdev-devel@linuxdriverproject.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, dan.carpenter@oracle.com Subject: Re: [PATCH v3] staging: dgnc: check if kzalloc fails in dgnc_tty_init() Message-ID: <20150407142444.GB31260@sudip-PC> References: <1428410417-18524-1-git-send-email-giedrius.statkevicius@gmail.com> <1428415875-23797-1-git-send-email-giedrius.statkevicius@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1428415875-23797-1-git-send-email-giedrius.statkevicius@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 07, 2015 at 05:11:15PM +0300, Giedrius Statkevičius wrote: > If one of the allocations of memory for storing a channel information struct > fails then free all the successful allocations and return -ENOMEM that gets > propogated to the pci layer. Also, remove a bogus skipping in the next part of > the initiation if a previous memory allocation failed because we won't execute > that if any of the allocations failed. Next, remove the misleading comment that > allocation could happen elsewhere. Finally, remove all (except in the ioctl > which can try to get information about a board that failed to probe) checks if > ->channels[foo] is NULL or not because probe failing if we can't allocate enough > memory means that this scenario isn't possible. i think now it became too many changes for a single patch.. regards sudip > >