Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754160AbbDGOiT (ORCPT ); Tue, 7 Apr 2015 10:38:19 -0400 Received: from mail-wg0-f53.google.com ([74.125.82.53]:33354 "EHLO mail-wg0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753718AbbDGOiQ (ORCPT ); Tue, 7 Apr 2015 10:38:16 -0400 Date: Tue, 7 Apr 2015 17:37:49 +0300 (EEST) From: =?ISO-8859-2?Q?Giedrius_Statkevi=E8ius?= X-X-Sender: giedrius@localhost.localdomain To: Sudip Mukherjee cc: =?ISO-8859-2?Q?Giedrius_Statkevi=E8ius?= , 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() In-Reply-To: <20150407142444.GB31260@sudip-PC> Message-ID: References: <1428410417-18524-1-git-send-email-giedrius.statkevicius@gmail.com> <1428415875-23797-1-git-send-email-giedrius.statkevicius@gmail.com> <20150407142444.GB31260@sudip-PC> User-Agent: Alpine 2.03 (LNX 1266 2009-07-14) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323328-685467047-1428417474=:19037" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1761 Lines: 38 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323328-685467047-1428417474=:19037 Content-Type: TEXT/PLAIN; charset=utf-8 Content-Transfer-Encoding: 8BIT On Tue, 7 Apr 2015, Sudip Mukherjee wrote: > 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 If I split this into two patches then they both would have to be applied and Greg or someone else could miss that one patch depended on another and leave the kernel in a partial state so I think it's best to keep it in one. Lets see what other people have to say. Su pagarba / Regards, Giedrius --8323328-685467047-1428417474=:19037-- -- 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/