Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753756AbcLITKD (ORCPT ); Fri, 9 Dec 2016 14:10:03 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:46508 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750756AbcLITKB (ORCPT ); Fri, 9 Dec 2016 14:10:01 -0500 X-ME-Sender: X-Sasl-enc: ZAVKPh0wuiy3qs9NUEu49Rkte6W/vNM9MujSTZiQgRSL 1481310600 Subject: Re: [PATCH] md: Combine two kmalloc() calls into one in sb_equal() To: SF Markus Elfring , linux-raid@vger.kernel.org, Shaohua Li References: Cc: LKML , kernel-janitors@vger.kernel.org From: Bernd Schubert Message-ID: <71044708-c5e4-3a14-b162-dfc600311a60@fastmail.fm> Date: Fri, 9 Dec 2016 20:09:58 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 586 Lines: 27 On 09.12.2016 19:30, SF Markus Elfring wrote: > From: Markus Elfring > Date: Fri, 9 Dec 2016 19:09:13 +0100 > > The function "kmalloc" was called in one case by the function "sb_equal" > without checking immediately if it failed. Err, your patch actually *replaces* the check. So where did you get the idea from that it is not checked immediately? [...] > - tmp1 = kmalloc(sizeof(*tmp1),GFP_KERNEL); > - tmp2 = kmalloc(sizeof(*tmp2),GFP_KERNEL); > - > - if (!tmp1 || !tmp2) { > - ret = 0; > - goto abort; > - } This is not immediately? Bernd