Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp2241609rwa; Mon, 22 Aug 2022 04:48:09 -0700 (PDT) X-Google-Smtp-Source: AA6agR4tMEudP2qDctxPBcoTd+2USsgWts14gFKQ/uGOKzRmRBvOv+02h8or04x8zqGve9D9724Z X-Received: by 2002:a05:6402:3482:b0:446:dd44:7125 with SMTP id v2-20020a056402348200b00446dd447125mr2166538edc.65.1661168889102; Mon, 22 Aug 2022 04:48:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661168889; cv=none; d=google.com; s=arc-20160816; b=mXSytvefO09SA/bcMVbSVjpr0D+VhyPXi7Md6r3LE0wH6/6VKQopAikazadubX07os Czxuurj+78Y2F0xgKaKOemIHK5qFRKzEPhpAKNiBYaZsR5zQqtCDfY+5XkyTNja2zXtG bCx09hSKXlvoHWOJIY9KstPjlC4zUHUq3xGHIR+RwdUHHyyhUm92WNGE9Uesj/qNY2Je 586gL6RtYFAnnLH+qJSW1BvL4qzHzcfRfLiVKVrQlrS4y7sT+swUOtk1AElBMK7rhGXV 0FvA3sq+8WNzSrditzu86PE1FNFBkB6KZPBbf7SkseeFSZT5CKFU5m9xKReHUhkiyXzk d2KA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:user-agent:date:message-id:subject:from:cc:to; bh=7fRIMdtrKFL/eDc+kzYQNEjyQUaE/T8WqVQTzqhgzE4=; b=cpIO6+be7Lbw0tbCWa6xlTFI+JH8iAH5TgOAch6gfrRDGujeq5v4ewd9Zjb8m1IKlq I3lX0eIhGDwLuzU1izZt5IuAJYgbGzO2BcPhn7EpMqiMcPsELOnloXvHyTbGOad41MvZ IySyvYw40JuICT4PKMl2oXlhjRiQlnZjf3xY+hVlUJAgeJmcq51cydblZs/s3Mozgfdb 6faum0X29p0G5AK4BsV6DQXPbU829i2PU8tY3+GTeMqz4urcC2mkxyWOTyioJxTiN0iQ IEBvy0eUp4ZWOXl7Ivaisd9QSi2bU+ndHMgzQnu8LhIG6T7oZ6kjD1jPH+7DIqGZg2B6 sfQw== 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 ss26-20020a170907c01a00b0073d9238714csi74720ejc.618.2022.08.22.04.47.43; Mon, 22 Aug 2022 04:48:09 -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 S234738AbiHVLqd (ORCPT + 99 others); Mon, 22 Aug 2022 07:46:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234434AbiHVLqc (ORCPT ); Mon, 22 Aug 2022 07:46:32 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FBFB30F5B; Mon, 22 Aug 2022 04:46:30 -0700 (PDT) Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MB9Tw5dntzlVjr; Mon, 22 Aug 2022 19:43:16 +0800 (CST) Received: from kwepemm600003.china.huawei.com (7.193.23.202) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 22 Aug 2022 19:46:09 +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; Mon, 22 Aug 2022 19:46:08 +0800 To: "Darrick J. Wong" , , "linux-kernel@vger.kernel.org" CC: linfeilong , wuguanghao , From: Zhiqiang Liu Subject: [PATCH] xfs: donot need to check return value of xlog_kvmalloc() Message-ID: <514e5e4b-e7c8-365f-8459-75974c067993@huawei.com> Date: Mon, 22 Aug 2022 19:46:07 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.249] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) 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,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 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; -- 2.33.0