Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3321677rwa; Tue, 23 Aug 2022 02:48:12 -0700 (PDT) X-Google-Smtp-Source: AA6agR7ouTRmD5GeywqXcvBEq6gyROFuy8xdED0yCKa1ps9aSj5Ru6jhL8EPHux46GygdfH0LC7J X-Received: by 2002:a05:6402:4446:b0:43b:e1f4:8525 with SMTP id o6-20020a056402444600b0043be1f48525mr3023571edb.236.1661248092712; Tue, 23 Aug 2022 02:48:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661248092; cv=none; d=google.com; s=arc-20160816; b=DTB/cZenOwPsrUNfmSTJux4Z9dpnLfLmFj0mYl04mZpTKL2KL3yYa4m5gKoM98hSA0 jQbSWB4Hdnov0vRMb5+bTkuEnq0L/8P5K9XpmjkIAR3zPd04ztwjhyU6Nlegl352FQPc 7uMkg19hHGcDRBxt2CL3jcwmqqiK7ZoLxDaFAituMdEtsgyNp6gH9IzW2HHGH3qrffrd i9PNy6IPiWmFciIyZPgBIsH/GafyJfrnJ92XWIdBkgb8IKiSkGGZQz832Q+6yDauelKo vcALaXvbyEmeAwsonpNBEFfKnTfNsF1fFskHKLjMFRsU5nvYrtD9B0TZj3JR9JRHMG6k iiCg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DpN1O3mZUSG0IbH6K0/I5SHUJcfd3QaFMx9g0hN6Psg=; b=NNrYM/cRkBh/fxtn3BrLYoaH9Z7DFKAk8Ezaq+Tj1dqokq9h/kb/GY3F1rc+tSCrXU 3mMDvzgXId0J26dG8XAOz6WuhcnAGq1gWf7WDEpMOEAmu0Q4ssIUNa34bLlWW3ubVgI2 AYDyGIUwxz6Zx/+F4ErSc/mM5u3O0TnGrbvu54SE10oXUWuD6u/iuV6SyaUUzdyTUybs nWHFXR5lB4IoQJa2JyybhAV1pL1LOjaNX1+fk1j6PWiCED2SNr5QzIWrFh45R8E/18Lm dm08A4770j34mpudZcwKoZm3oSlyKBCdVLyCqxEAdWyYezERTEaeWL89Pmc2mIOHiAcf /GQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KpvOCRbz; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hb44-20020a170907162c00b0073d6c318f49si6572284ejc.443.2022.08.23.02.47.46; Tue, 23 Aug 2022 02:48:12 -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=@linuxfoundation.org header.s=korg header.b=KpvOCRbz; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349288AbiHWJPG (ORCPT + 99 others); Tue, 23 Aug 2022 05:15:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348555AbiHWJMU (ORCPT ); Tue, 23 Aug 2022 05:12:20 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 432C075380; Tue, 23 Aug 2022 01:31:39 -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 dfw.source.kernel.org (Postfix) with ESMTPS id CC34A6123D; Tue, 23 Aug 2022 08:31:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D3D2AC433D6; Tue, 23 Aug 2022 08:31:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661243498; bh=bvxl4NfAPWoJeKXPXZQ9lKtZkp/R6dPMZbid1WSJKj0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KpvOCRbzYcc9tLxuEHB1Hlf+U/5EaDF6N0QwR6AnAxAomSwUq2PJnPlRLP09q9Pfk RfBALYSrgeLrx6fuQIOibX1vWGxLg6DoENdcyfdUREJOKZ+AOvmVfybWTigV895NAX D/4A/lhH/WRw50fAQUBreLWHmwh0sJyTU5645YXg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrew Donnellan , Christophe JAILLET , Sasha Levin Subject: [PATCH 5.19 295/365] cxl: Fix a memory leak in an error handling path Date: Tue, 23 Aug 2022 10:03:16 +0200 Message-Id: <20220823080130.533116012@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080118.128342613@linuxfoundation.org> References: <20220823080118.128342613@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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,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 From: Christophe JAILLET [ Upstream commit 3a15b45b5454da862376b5d69a4967f5c6fa1368 ] A bitmap_zalloc() must be balanced by a corresponding bitmap_free() in the error handling path of afu_allocate_irqs(). Acked-by: Andrew Donnellan Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/ce5869418f5838187946eb6b11a52715a93ece3d.1657566849.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/misc/cxl/irq.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/misc/cxl/irq.c b/drivers/misc/cxl/irq.c index 5f0e2dcebb34..ac3795a7e1f6 100644 --- a/drivers/misc/cxl/irq.c +++ b/drivers/misc/cxl/irq.c @@ -350,6 +350,7 @@ int afu_allocate_irqs(struct cxl_context *ctx, u32 count) out: cxl_ops->release_irq_ranges(&ctx->irqs, ctx->afu->adapter); + bitmap_free(ctx->irq_bitmap); afu_irq_name_free(ctx); return -ENOMEM; } -- 2.35.1