Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp4488461rwe; Tue, 30 Aug 2022 11:00:13 -0700 (PDT) X-Google-Smtp-Source: AA6agR5rJW84kJ1wgGG8M5OvfMs+cY1n3ErSzjJMCV/DftUA/l41mwmAX76VxHlT7prOjBZDG1tH X-Received: by 2002:a05:6402:1f01:b0:445:fbe8:4b2e with SMTP id b1-20020a0564021f0100b00445fbe84b2emr21340420edb.192.1661882413265; Tue, 30 Aug 2022 11:00:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661882413; cv=none; d=google.com; s=arc-20160816; b=tsmH14SBjmUrJ0bSb64hRIhGqXRnxdk5VpH5CYtRcOSNTkvW19Znp+PsnpyzeWqJnM 41YCElJF+Ei3Sax1LooqwpO1CJzA1PYxLnuVqqhLxT1gXBXSiFuGwOvx/X4XMd4Oz8Ek Pg+6ZrHHjegayjivncJvevcBW4a/Wo8uJyPdEkAhrrj10byn+2T7HLO8IkXhkTNXtUqU 3fAA831XthVB2+mEAGkqmk8Z3vFHBFy7LNC2PBIc/4LROvbWF2ZEyoK3amcCxm/ec9mS 0JhWLDdj3ZC12exJQHntJuMAVWqs5fDzCIwgXVEvDpn4l76gUBFMFTmzZqSa4H4ji2Lu 8ESw== 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:date:subject:cc:to:from :dkim-signature; bh=EL3zXSXbP6E0PcQEtb/9vFIf/ELssweic61EEWJWhKE=; b=qyKFjnoo8DOQ9/b3l4yp2/hi5PiYOuJsAbyDbt6ZttcycvOfHhvGykakaT11rQ8SDa DGKVMISuuLrS6GOCiNMm1uWTVurg9dOIQWcjneezEuxQDzswg+ylZzTsua1CUa7ZlfW5 KM4u+83kFOncbgxVMnoE8lKHea2/s8Jrr9KrDHAjs4JwHaTlBAWDIQ4yD3V3PKzMK6wU w3uOW/s02H2noXUnWiRntLK5boX1k1PFoyG52d2FLuzsZPzcOij9MBlik0iqZEgFVa6N dDuZ4e4F7GTPUyoRkZzhx0+29+yC7mXp52t0oFL1F4ZaPzRWwLU0DVjPJcIAPPnUh0KV 07zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PAEsvujd; 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 h13-20020a50c38d000000b0044617f0fd6bsi9489034edf.79.2022.08.30.10.59.47; Tue, 30 Aug 2022 11:00:13 -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=PAEsvujd; 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 S230188AbiH3RS5 (ORCPT + 99 others); Tue, 30 Aug 2022 13:18:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229752AbiH3RSf (ORCPT ); Tue, 30 Aug 2022 13:18:35 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85E59D345B; Tue, 30 Aug 2022 10:18:34 -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 0947661781; Tue, 30 Aug 2022 17:18:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62552C433D7; Tue, 30 Aug 2022 17:18:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661879913; bh=KeEa8niuoX+78r0QBUW0t5EQ4R4rJWSESiREHqZApaQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PAEsvujdeFelI2/FHZJEEg4DRT+1vyC1xM/O9ZGaIv5OQ7H7r9EfHkz7Ha6nImwDk 5RFyRJ7pJ8rrlLW837eWYhd99SPV8IFIvTbEQvPn1bjyOdIkdVkIfOBLerVl/ZD75W jSVmq6/+H8Dm3CbEdPs52vWjkWEdqMiikaGnvYk/TaWUlQs3JuOAV/vJfeHLUL9cc8 p2IJ/NTIFssu6MOOl1axmaTSXcpNpx289i9E8Km0U6HEjG+dtL29VYSGA6EAu+1lwR zg1gnTnQKw5ph64RhMX/9NEZrGbZC+Xno9AcBbvLsUZ9PqurwfozO3PQLgIIjnQEmX 5aXlqkR3v1iUA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Guixin Liu , Sumit Saxena , "Martin K . Petersen" , Sasha Levin , kashyap.desai@broadcom.com, shivasharan.srikanteshwara@broadcom.com, jejb@linux.ibm.com, megaraidlinux.pdl@broadcom.com, linux-scsi@vger.kernel.org Subject: [PATCH AUTOSEL 5.19 04/33] scsi: megaraid_sas: Fix double kfree() Date: Tue, 30 Aug 2022 13:17:55 -0400 Message-Id: <20220830171825.580603-4-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220830171825.580603-1-sashal@kernel.org> References: <20220830171825.580603-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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 5b5885d9732b6..3e9b2b0099c7a 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -5311,7 +5311,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