Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp6848761rwn; Tue, 13 Sep 2022 09:48:22 -0700 (PDT) X-Google-Smtp-Source: AA6agR5+A0XVrRRLeJFHCwrZMXcw5koZF3gCT7PUw0JeVKIJzZ+8PE3Qkzwas+N+ef+eRA9ApUnU X-Received: by 2002:a17:903:32c2:b0:178:2ca7:fade with SMTP id i2-20020a17090332c200b001782ca7fademr11798025plr.71.1663087701783; Tue, 13 Sep 2022 09:48:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663087701; cv=none; d=google.com; s=arc-20160816; b=yCa33hyj5G4wJjqbi7jSS33cIsQx6iLuvaxKDYe3yjLwSq6DGgvIj2MC67WIcgtNLg v+2gAvYkJuJAJFAtU2Zmg314BY2ohSqyoFv4g6iJMbgadIYK74JkBWawFleT5rf09E9L wBlY5ldajuNQj0aqG2I1xBOl4PmGheaTGrHpUwmIvfQfUw/nf6FnS2pgs/zMJXO/dE7E nyDTRbM05hJTr9WlrhUKmG7xMZ+zWpd5IA1QrMjA9yCUOR/7lUBu71Na6EEzzinvXu/1 Y3oF85Q9MDY1G6kFa+NPoU6JQceACGXH24xiz+b82OaqoQsALn2dAO5LrNhiopoH14jb pc+A== 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=xTmDJjUL/E0JCS49YAx70fKhq+vwghQfW04Q/4hOxT0=; b=mOYiUmJvDESSao5YnbWLznclKV/qe/ZOyS+5gsf63dvSDnt+sg8mVAB62Ia9w/OFeG Gx118AWPD5ZV8zK4elwzt2ABNiaQnx+hS6qNgxRc9zvVM3D6LPedUif3Zyl2dsCJQP0q PJfSBA5euzOpJRTWwONSmdRe0QqCQHcF8fJfoNFGWdR+A3Wc0yZIybDCkIFTs4Mua3hf Pt3TDN5/g9KzfnuUyu26L0FshUmrPktEznE8CnIS5hafaQXn656V+HpEprMX3qV/tVT3 b2yr27x9TAclRbHyfyvJ9LnZZ4vKHuTkBJiRSF+MIyWuD5D4viVQeARkw/wCe8jewhV/ Fg2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VvmcfMFX; 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 oj1-20020a17090b4d8100b00202d76372b3si6914837pjb.9.2022.09.13.09.48.08; Tue, 13 Sep 2022 09:48:21 -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=VvmcfMFX; 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 S231869AbiIMPnq (ORCPT + 99 others); Tue, 13 Sep 2022 11:43:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232073AbiIMPnT (ORCPT ); Tue, 13 Sep 2022 11:43:19 -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 0456785F9A; Tue, 13 Sep 2022 07: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 ams.source.kernel.org (Postfix) with ESMTPS id CD757B80EFD; Tue, 13 Sep 2022 14:22:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23015C433C1; Tue, 13 Sep 2022 14:21:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663078919; bh=WHrlCYdi1bSrzecsw/MQNXNF2LLpNKQ3Aly2GDKG3Oc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VvmcfMFXK2raODed7VMzEWw19YXQ+x9+XsmLZaiHwnSeOwcf2AHmFYaoe//sdjxqk /ujrjyfxxnVHnvtmo61HIbtHtT5OfTmHgexhg6PxK7Tfte7iwq4ANI4kbEQShdBOc7 jVvv3Tx2H0CfHf6Q2TljcuFt0DMJFewUWInwB2ds= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sumit Saxena , Guixin Liu , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 5.10 12/79] scsi: megaraid_sas: Fix double kfree() Date: Tue, 13 Sep 2022 16:04:17 +0200 Message-Id: <20220913140350.888498249@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220913140350.291927556@linuxfoundation.org> References: <20220913140350.291927556@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: Guixin Liu [ Upstream commit 8c499e49240bd93628368c3588975cfb94169b8b ] When allocating log_to_span fails, kfree(instance->ctrl_context) is called twice. Remove redundant call. Link: https://lore.kernel.org/r/1659424729-46502-1-git-send-email-kanie@linux.alibaba.com Acked-by: Sumit Saxena Signed-off-by: Guixin Liu Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/megaraid/megaraid_sas_fusion.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index 13022a42fd6f4..7838c7911adde 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -5198,7 +5198,6 @@ megasas_alloc_fusion_context(struct megasas_instance *instance) if (!fusion->log_to_span) { dev_err(&instance->pdev->dev, "Failed from %s %d\n", __func__, __LINE__); - kfree(instance->ctrl_context); return -ENOMEM; } } -- 2.35.1