From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joe Perches Date: Tue, 23 May 2017 16:39:37 +0000 Subject: Re: tipc: Delete error messages for failed memory allocations in three functions Message-Id: <1495557577.2093.66.camel@perches.com> List-Id: References: <7ac9d513-6f9f-a096-e68f-81a722c2723c@users.sourceforge.net> <1495548133.2093.58.camel@perches.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: SF Markus Elfring , tipc-discussion@lists.sourceforge.net, netdev@vger.kernel.org Cc: "David S. Miller" , Jon Maloy , Ying Xue , LKML , kernel-janitors@vger.kernel.org On Tue, 2017-05-23 at 18:23 +0200, SF Markus Elfring wrote: > > tipc_subseq_alloc does a kcalloc (memset to 0), > > half of which is immediately overwritten. > > > > In other words, don't just blindly remove stuff, > > understand what it does and improve it. > > Do you suggest another specific source code transformation pattern here? For the somewhat hard-of-thinking, something like krealloc would do nicely. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968623AbdEWQjp (ORCPT ); Tue, 23 May 2017 12:39:45 -0400 Received: from smtprelay0095.hostedemail.com ([216.40.44.95]:58125 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1759803AbdEWQjm (ORCPT ); Tue, 23 May 2017 12:39:42 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::,RULES_HIT:41:355:379:541:599:968:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1538:1567:1593:1594:1711:1714:1730:1747:1777:1792:2393:2559:2562:2692:2828:3138:3139:3140:3141:3142:3622:3865:3866:3867:3868:3870:3871:3872:3873:4321:5007:10004:10400:10848:11026:11232:11658:11914:12740:12760:12895:13069:13255:13311:13357:13439:14659:21080:21212:21451:21627:30012:30054:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: mind48_544adbbc79605 X-Filterd-Recvd-Size: 1540 Message-ID: <1495557577.2093.66.camel@perches.com> Subject: Re: tipc: Delete error messages for failed memory allocations in three functions From: Joe Perches To: SF Markus Elfring , tipc-discussion@lists.sourceforge.net, netdev@vger.kernel.org Cc: "David S. Miller" , Jon Maloy , Ying Xue , LKML , kernel-janitors@vger.kernel.org Date: Tue, 23 May 2017 09:39:37 -0700 In-Reply-To: References: <7ac9d513-6f9f-a096-e68f-81a722c2723c@users.sourceforge.net> <1495548133.2093.58.camel@perches.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.6-1ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2017-05-23 at 18:23 +0200, SF Markus Elfring wrote: > > tipc_subseq_alloc does a kcalloc (memset to 0), > > half of which is immediately overwritten. > > > > In other words, don't just blindly remove stuff, > > understand what it does and improve it. > > Do you suggest another specific source code transformation pattern here? For the somewhat hard-of-thinking, something like krealloc would do nicely.