Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F493C61DA4 for ; Thu, 2 Feb 2023 09:35:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232377AbjBBJe7 (ORCPT ); Thu, 2 Feb 2023 04:34:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232478AbjBBJeS (ORCPT ); Thu, 2 Feb 2023 04:34:18 -0500 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8BEA37F25 for ; Thu, 2 Feb 2023 01:33:22 -0800 (PST) Received: by mail-pj1-x102e.google.com with SMTP id e8-20020a17090a9a8800b0022c387f0f93so4982768pjp.3 for ; Thu, 02 Feb 2023 01:33:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fM2J8wywmFAkpO23AWoNhmUW5UYZgKdN8YXNnF3yVyM=; b=Wo251TnMqE/xUy53nVYNHNixxFzGh7uMlcDfpYQ+hGF2EY+SJzxpkjwBz48HPc7PdI mCFS238qz28Vl58shnx7iHLNFk04lJSx6DBPVu/g0MdME9NBiPwyf8pcdWn948EQ+b1X 3L4mbybXZoI3HB7ZZ11CWlSWrV874N3enXLiqrQs+JVJQpWroJo70oWsm4M3ixY85h6Y 1V3zFiUAuGXxynacB3GnOZ6Fk43JZUw388DSIibs9r7coNVmhMD43BAonOhmqrwmwsyY kIwSbkbWIdAIBN/o2wG9FPcqHZz+60XzLDiKc1sesKImRjuPrXft04vWwuh90EckuM8P +84Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fM2J8wywmFAkpO23AWoNhmUW5UYZgKdN8YXNnF3yVyM=; b=kOgHsv12HBLf7k28EWLfNhBf1/80VgsA8Ioie8ZXPHhjffwpOdc5KzARgxy/wKS7ct D2TEGwrES/UjNMNldQ52sBiofGWVBWKc1Bo8DY+Pd3uq3rsDZtL54LyeTIcRnqpwo34N lsm7/yMy+m0W9xgx/dIWK9cJc3wsTVnlEBuy3VRbsfGVGCtGywWe+tG/DIum+Si/U2oI t5rIwUgzOLUs0MczXzc4QsKDOlkHzjDqQu4Z3eJ/i6m6PSaTqObVAwK9YCmuVScDueQq RvLC2vMXbuOH2UeimPGYxL9+7ZKChmFjUt6864PRbRpcbd6ontbC4Pfdjbx2wqNTke6s Ds1A== X-Gm-Message-State: AO0yUKW/mlSvcFMqEcjsmR5qOTpub7jaMCmTb/tw26q4J+0VXFF7BESg bI9ijqyLKEcdVlWwFZuxk+WYxw== X-Google-Smtp-Source: AK7set+6yxCwb4C8Sjo5cbMP62x/cHWST+OuLy22i2oHl2I2Ffq042rnTbWnJNsZq82jcV0XES36RQ== X-Received: by 2002:a17:902:cecb:b0:196:86c2:ee89 with SMTP id d11-20020a170902cecb00b0019686c2ee89mr6913134plg.3.1675330402292; Thu, 02 Feb 2023 01:33:22 -0800 (PST) Received: from C02DW0BEMD6R.bytedance.net ([139.177.225.243]) by smtp.gmail.com with ESMTPSA id c10-20020a170902848a00b0019254c19697sm13153343plo.289.2023.02.02.01.33.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Feb 2023 01:33:21 -0800 (PST) From: Qi Zheng To: gregkh@linuxfoundation.org, rafael@kernel.org, j.vosburgh@gmail.com, vfalico@gmail.com, andy@greyhouse.net, vireshk@kernel.org, nm@ti.com, sboyd@kernel.org Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, netdev@vger.kernel.org, Qi Zheng Subject: [PATCH 2/3] bonding: fix error checking in bond_debug_reregister() Date: Thu, 2 Feb 2023 17:32:55 +0800 Message-Id: <20230202093256.32458-3-zhengqi.arch@bytedance.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: <20230202093256.32458-1-zhengqi.arch@bytedance.com> References: <20230202093256.32458-1-zhengqi.arch@bytedance.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since commit ff9fb72bc077 ("debugfs: return error values, not NULL") changed return value of debugfs_rename() in error cases from %NULL to %ERR_PTR(-ERROR), we should also check error values instead of NULL. Fixes: ff9fb72bc077 ("debugfs: return error values, not NULL") Signed-off-by: Qi Zheng --- drivers/net/bonding/bond_debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/bonding/bond_debugfs.c b/drivers/net/bonding/bond_debugfs.c index 4f9b4a18c74c..594094526648 100644 --- a/drivers/net/bonding/bond_debugfs.c +++ b/drivers/net/bonding/bond_debugfs.c @@ -76,7 +76,7 @@ void bond_debug_reregister(struct bonding *bond) d = debugfs_rename(bonding_debug_root, bond->debug_dir, bonding_debug_root, bond->dev->name); - if (d) { + if (!IS_ERR(d)) { bond->debug_dir = d; } else { netdev_warn(bond->dev, "failed to reregister, so just unregister old one\n"); -- 2.20.1