Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp3439373rwi; Tue, 1 Nov 2022 21:44:02 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6Ccy6JWBTim6pRnHmTNwv9UqwxmFz3UNTU2ElcZh6zJf9YP3D4EeNZYEM4sAhr9bxDWt2/ X-Received: by 2002:a17:906:749a:b0:7ad:fc15:c9f0 with SMTP id e26-20020a170906749a00b007adfc15c9f0mr2812247ejl.68.1667364241815; Tue, 01 Nov 2022 21:44:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667364241; cv=none; d=google.com; s=arc-20160816; b=JMi6EHCw4utgf55fF+J8mfHyWowzB2YNCxthCW9iTtVNt/Ks4JyZ8M4weyPM5MTPNB MnL54uXN/Ma9h/7XROn/1NJcmu9xTFgBq/7rZOYcnUQcXPvM1ugawEOCSBROsT0oyx+w XwGVDBdGeYh8ZingDrEY9npLP2CelKq6dIrLcRpedb6qLTsmZEX8vZncwzXY0B2quKrR R3l9xQP/tQL416X92ACwe2uRawyt2vTrQIlT1DkrUgJwUhwHpqTKq13iJw5YIjLMC91M eJfT//nGAGK0Bq+H4Xh9MEUeprHk/Ltq6SRqh33u8omAyTptnPj5EqaPxA7d9y4Jo7IE jatg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=vQcHj3DxvdZMI3JG/7lQi9QnzDCoGi1SUcy+FO31ezk=; b=iyNph0YIebbOYykDZbC4evENUJdvzoESffpMho88zwhN7HGKmmsZcqnDVSl+of36Qb gmofn1qx5ipU7cKFA4q07I0bEn/A2HStpeCIuNe+SE0fsbfGYdKS35AoYslJGprl5Mab xfjIZmG9Z8y0koyh52TqGwVtcoI1zDMS12NWRsgeyxU3Dg+YYAGwmRT9ZJ1D7e73NMlg GF2BIYoTDY8QPiG98tQE4hiO4MbxVYlC3KzgpDO6W+mRaCspgnZd0XyD2iDTFAs61pgb i6fyosK88EM42ptUT7kUMeSHWJUG74yq83L7O0+TMqCvmhWFN/Mi+hXDB/HaqzjrmJX+ ChiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GNDBrB2K; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ne31-20020a1709077b9f00b007adb78db1adsi15145651ejc.804.2022.11.01.21.43.38; Tue, 01 Nov 2022 21:44:01 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GNDBrB2K; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229954AbiKBEeK (ORCPT + 97 others); Wed, 2 Nov 2022 00:34:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229534AbiKBEeJ (ORCPT ); Wed, 2 Nov 2022 00:34:09 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 923EA1FCED; Tue, 1 Nov 2022 21:34:08 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 347C3B82055; Wed, 2 Nov 2022 04:34:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E303C433C1; Wed, 2 Nov 2022 04:34:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667363645; bh=cGNjvtOYEMURE3oMH/1D1MQCQCYunNYL8zTW+/C/DQ0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=GNDBrB2K0kjKRaLKFfXndBZi/IdbsSkg0av+ojWRMY/IFSBhV3zIG9+AsE/gdsIOC M671X8qQodprjwOxL/onL48Kyl2PlRwaHqK5saAuWi+MwJJs96/6t72kBFK8d1R/Sv IQDpL3TQTM1qjsP0FT9TWyHga73awegLrP8f6JONS+p6atSEotQv/AqM0NcxdH5WSa qfAXKA4Vpt4HdoJqkh6vyDJy2z7Ax2mca9Mrr7hRXAgcyndyq0RetLrsoGxsQlkyJU hMHIqgB5V4G+RCUM+bYYnFR7jOnsH08o3Vmb4/ng8ZDfpjipGXDpgFVyPV5gXm5nD7 BLZVVnuaWohZg== Date: Tue, 1 Nov 2022 21:34:04 -0700 From: Jakub Kicinski To: Alex Elder Cc: davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, mka@chromium.org, evgreen@chromium.org, andersson@kernel.org, quic_cpratapa@quicinc.com, quic_avuyyuru@quicinc.com, quic_jponduru@quicinc.com, quic_subashab@quicinc.com, elder@kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next 9/9] net: ipa: use a bitmap for enabled endpoints Message-ID: <20221101213404.3e4c3b8f@kernel.org> In-Reply-To: <20221030001828.754010-10-elder@linaro.org> References: <20221030001828.754010-1-elder@linaro.org> <20221030001828.754010-10-elder@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 On Sat, 29 Oct 2022 19:18:28 -0500 Alex Elder wrote: > /* Set up the defined endpoint bitmap */ > ipa->defined = bitmap_zalloc(ipa->endpoint_count, GFP_KERNEL); > ipa->set_up = bitmap_zalloc(ipa->endpoint_count, GFP_KERNEL); > + ipa->enabled = bitmap_zalloc(ipa->endpoint_count, GFP_KERNEL); > if (!ipa->defined || !ipa->set_up) { This condition should now check if ipa->enabled And the error handling patch needs to free it, in case it was something else that didn't get allocated? Frankly I have gotten mass-NULL-checks wrong more than once myself so I'd steer clear of those, they are strangely error prone. > dev_err(dev, "unable to allocate endpoint bitmaps\n"); this error message should not be here (patch 5 adds it I think) memory allocation failures produce a splat, no need to print errors > + bitmap_free(ipa->set_up); > + ipa->set_up = NULL; > bitmap_free(ipa->defined);