Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp995755rwe; Fri, 26 Aug 2022 20:50:26 -0700 (PDT) X-Google-Smtp-Source: AA6agR6M1SZkCIIjOrZhBNzLQNChJ0n6eoHbEbTS4IVIUixVOGmMOW2jRgix0+/1oRKWZCr4zSba X-Received: by 2002:a17:90b:1096:b0:1fd:5c09:bd79 with SMTP id gj22-20020a17090b109600b001fd5c09bd79mr6977889pjb.198.1661572226647; Fri, 26 Aug 2022 20:50:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661572226; cv=none; d=google.com; s=arc-20160816; b=Hidlwkv8tHE3d+z9EGsDUhwHK8QiSNC3y1JaP7b4gdnUcrRRYEJ27tEgBwXnWDcUqz jD64BO4ypZeQMn/jwLSn4FRNPIL7jjVQF+n9xtSSwnPXp99ZmpX7WQbTP6Izc6xQPB0V fc9AQSfrgIW/ZXm+nZ2XdmIhgzp+cxmQIkwq2AGdAmG7d8a4auYCzeS8LxTvlAWYQumF 4KWtJoZ9JFjcei5JWoaeNNTZxX25HhC0MWOQcA/O5hQnmSYcMvS1SXiVJZ6Sp6nqO2Rw +aXpoDrsPKdmBS4sDlUsqR5kz1JdLp6aMHWmtRMksNpyVgmc8DpG8qvpQZtASqPY3zeh 2VFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=KXdG+tC67eTrQENYTb81dBgQ2ljw9ftAktMkSkxdDUs=; b=dyF8bJ3Rprd7REqi0pW0pCOeV7UJkY9o6PYjQG/oxW7qo7ryIfZEjx6lHjtJs4tVLl PKdAcxh8bOrCilsUex/nrp6fECmhk1qySukQq+0evgsSwfkXgzkf9m38BOYwPh3kjft8 w5cdbF+TPVm/SQABNkncMT6Pi1F6uf7xYQg/kw2uqmY0ODAu78k21MjkFeGgkYw4AP7y 5ryDTmKgEd8+cZ98A9QVjqZ6vQtmyzLgx/AshddSEavfesADN3JxmtemUUTeEJL9i0wb Sbw5TpfRTaFNnPQ86xgYOIlvArjv9TsKh0NdauXthTJUdo13axcD0l+nVTWd4UKm5NP8 AHpQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 204-20020a6301d5000000b0041ccba3f82dsi3195695pgb.693.2022.08.26.20.50.15; Fri, 26 Aug 2022 20:50:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345002AbiH0DLw (ORCPT + 99 others); Fri, 26 Aug 2022 23:11:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231216AbiH0DLu (ORCPT ); Fri, 26 Aug 2022 23:11:50 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D10E5B1ED; Fri, 26 Aug 2022 20:11:48 -0700 (PDT) Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.53]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4MF1sR44KMzGpqY; Sat, 27 Aug 2022 11:10:03 +0800 (CST) Received: from kwepemm600003.china.huawei.com (7.193.23.202) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sat, 27 Aug 2022 11:11:46 +0800 Received: from [127.0.0.1] (10.174.177.249) by kwepemm600003.china.huawei.com (7.193.23.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sat, 27 Aug 2022 11:11:45 +0800 Subject: Re: [PATCH] xfs: donot need to check return value of xlog_kvmalloc() To: "Darrick J. Wong" , , "linux-kernel@vger.kernel.org" CC: linfeilong , wuguanghao References: <514e5e4b-e7c8-365f-8459-75974c067993@huawei.com> From: Zhiqiang Liu Message-ID: Date: Sat, 27 Aug 2022 11:11:44 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <514e5e4b-e7c8-365f-8459-75974c067993@huawei.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.174.177.249] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemm600003.china.huawei.com (7.193.23.202) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org friendly ping.. On 2022/8/22 19:46, Zhiqiang Liu wrote: > In xfs_attri_log_nameval_alloc(), xlog_kvmalloc() is called > to alloc memory, which will always return > successfully, so we donot need to check return value. > > Signed-off-by: Zhiqiang Liu > --- > fs/xfs/xfs_attr_item.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/fs/xfs/xfs_attr_item.c b/fs/xfs/xfs_attr_item.c > index 5077a7ad5646..667e151a2bca 100644 > --- a/fs/xfs/xfs_attr_item.c > +++ b/fs/xfs/xfs_attr_item.c > @@ -86,8 +86,6 @@ xfs_attri_log_nameval_alloc( > */ > nv = xlog_kvmalloc(sizeof(struct xfs_attri_log_nameval) + > name_len + value_len); > - if (!nv) > - return nv; > > nv->name.i_addr = nv + 1; > nv->name.i_len = name_len;