From mboxrd@z Thu Jan 1 00:00:00 1970 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 8E8FAC77B7D for ; Mon, 15 May 2023 17:49:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244659AbjEORte (ORCPT ); Mon, 15 May 2023 13:49:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244740AbjEORtN (ORCPT ); Mon, 15 May 2023 13:49:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93BE4160AD for ; Mon, 15 May 2023 10:47:23 -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 7569462EF7 for ; Mon, 15 May 2023 17:47:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A7B4C433D2; Mon, 15 May 2023 17:47:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1684172842; bh=YNUE3CjRzcits5Y3Lfr8C5vP5LQ0h0diCD/kmVdyjsk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c+PJohLqqBxZk8csjer+BzcnEJVmVg0j+DymQIRx+5zngUFg1BB8zsn5U2GmIvx6J 2Vc/UzLRodA+o1leLz3hlt9q9EYQONc28+OXoWrC10tZG6PCyMj9YMpmo/VUhD6Kws gIBQKNaVqTJedjWXJ6CAzGOW+srGFfd0VvI1hVEg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Mike Snitzer Subject: [PATCH 5.10 283/381] dm clone: call kmem_cache_destroy() in dm_clone_init() error path Date: Mon, 15 May 2023 18:28:54 +0200 Message-Id: <20230515161749.560622095@linuxfoundation.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230515161736.775969473@linuxfoundation.org> References: <20230515161736.775969473@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Mike Snitzer commit 6827af4a9a9f5bb664c42abf7c11af4978d72201 upstream. Otherwise the _hydration_cache will leak if dm_register_target() fails. Cc: stable@vger.kernel.org Signed-off-by: Mike Snitzer Signed-off-by: Greg Kroah-Hartman --- drivers/md/dm-clone-target.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/md/dm-clone-target.c +++ b/drivers/md/dm-clone-target.c @@ -2221,6 +2221,7 @@ static int __init dm_clone_init(void) r = dm_register_target(&clone_target); if (r < 0) { DMERR("Failed to register clone target"); + kmem_cache_destroy(_hydration_cache); return r; }