Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2879585pxp; Tue, 8 Mar 2022 03:53:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJxTfmgmmPsyu0HEZLRyxBj3txiJrmqLLBeuQHPw7rL4hbdtUZsV+ME+IDPGKIef24Isd1c5 X-Received: by 2002:a17:906:c08a:b0:6ce:36f8:bfe8 with SMTP id f10-20020a170906c08a00b006ce36f8bfe8mr12992321ejz.52.1646740381470; Tue, 08 Mar 2022 03:53:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646740381; cv=none; d=google.com; s=arc-20160816; b=rtmkdu08ynhjkXw25VSzqfjw/UBkvc53kPt2YhTwNQz9EeJCcgFxqcWwyh5b36dvOz MdUSgRxJdpmdAeVtMUz5pMkGJ7EBCxbomPZR6mMWpIPHUXSh+JLmbzgo/H9iq10sVr64 zSZ7tTlOiwqUu69JaZkIZJThwm5pTNMxyzx0MWCP9eIqr9dDhNHLJon0UPnDERBd5NDc 1WYoLMKhss4Ouh+Q5V2mg0olFJZTCHcNORsEmFpnadpZOiHharXLf09lvkNu9juV3UVB BJjO1UYQsNTPGcWhBZ3OWE9y1b+RcHXJuFabelJyH/K3dhhEfU84mSj0TOpVzUJcHrHW IBNQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=EKWLtU4zz1/zFVHhrDZHE3rjhXGyfrW7xNSyA4kl7Rc=; b=1D/218fyDdI0s0+/N08sjPyWZliM2D+FvfxZzGCOX0SuQqDm2vZf4NmiYa8GIoqvA8 BaOyClJs+PCvTSR84M3A3Q8KvjaSTAOTI12WpVpZYUkZaIie6vtIV0BgCWxadI1boK8s KjRgTI2Lxz3IMpmXemrmC1v1F7luXs1sOxor1cH7BQUgZ1Ud98m0LCaFfkeCO88y2Yt1 BSc37h3CApk683QLhM6cMV79epkc6dlqNJ7C2PwW4Y7OiAL+zUbipWK5zBkidKdYGD3L 1YW9PteUPAD+JQm6a9n1QuFaIJz38s7aCo02LH9KpG3FoE+yWyoaEiZLN4dXqgB+Pei5 P7Mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=EAC94q4e; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i27-20020a170906091b00b006ced85cc07asi9329222ejd.715.2022.03.08.03.52.37; Tue, 08 Mar 2022 03:53:01 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=EAC94q4e; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343581AbiCHG5K (ORCPT + 99 others); Tue, 8 Mar 2022 01:57:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240919AbiCHG5J (ORCPT ); Tue, 8 Mar 2022 01:57:09 -0500 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F3F83D1C1; Mon, 7 Mar 2022 22:56:13 -0800 (PST) Received: by mail-pf1-x433.google.com with SMTP id e15so14968477pfv.11; Mon, 07 Mar 2022 22:56:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=EKWLtU4zz1/zFVHhrDZHE3rjhXGyfrW7xNSyA4kl7Rc=; b=EAC94q4eGyN3xC+1r+cts3HFagw0H+M6JLKx+cyOYKUUo6h1mskAeYIB2Zpl/7g7lV zaWJ9eB8cw8BRp8srEuKd+hP0RKDh3DnpkmIMFBXU/8mLMRUUpErwPSGnvk+kx3s5+ek 9rIIYuz0Whgr0z2yt001UTszg/8k8H6p61ULaY1A4mIRBxU9em5V8J2JLXUZQEhGA2GG A1C7FnxetOJjQT+XUzJj0XmBJbNn7zbpIlAMijj0orpw4FnXCeh+JhgNioZe8uX5Qez5 dHisvq13qwpP4FdHNQ0jJREeBCbS5C3oUWEcg0aluCar3ymNU62ohZPNVWWW0+OS5Tun JsOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=EKWLtU4zz1/zFVHhrDZHE3rjhXGyfrW7xNSyA4kl7Rc=; b=UwgKOcdzEb7h9HlkUqtIJ0Us7jPV+N8wUEdzNUf4Y206O8cry9026Gr0tGxTLfdlKN xiLcp6fO/zJshbIjHhrSI3M7jdIVHiV7fhEnwxRK160Cy1jyo7Epm0vjpQBH1+rLDvzV Lx+57HVCXpRubT3l8tKBtriuPgy6ATJWfLdwn9ArzFHRoFw24aRSBr8DnovQIaqc6uFS 4Xhmh28+S1Jtuva9q/KaS+93s23Mz3UmzFg4Oqc8Q9YmlUPc782T8gDioVakDwmX1zTl LtQEgvXphYDTuEBa48uDk0y126jX3YSdL09UkAwkT2mioeyAqFBHRQNJK4px9EWkwHXJ TlpQ== X-Gm-Message-State: AOAM532NxB1gYHGOkSGwLD+U9aVVB1b/i4G8+iY9xSv2Ovn9DjJUAArN B1e9Na9FNjTbcVBic2iz+44= X-Received: by 2002:a62:bd0e:0:b0:4f6:e07f:d4ee with SMTP id a14-20020a62bd0e000000b004f6e07fd4eemr14429505pff.46.1646722572865; Mon, 07 Mar 2022 22:56:12 -0800 (PST) Received: from ubuntu.. ([115.27.208.93]) by smtp.gmail.com with ESMTPSA id j17-20020a634a51000000b00378f9c90e66sm13706588pgl.39.2022.03.07.22.56.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 22:56:12 -0800 (PST) From: Yeqi Fu To: Hannes Reinecke , "James E.J. Bottomley" , "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, lyz_cs@pku.edu.cn, Yeqi Fu Subject: [PATCH 1/2] scsi: fcoe: fix memory leak Date: Mon, 7 Mar 2022 22:55:26 -0800 Message-Id: <20220308065527.90341-1-fufuyqqqqqq@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HK_RANDOM_ENVFROM, HK_RANDOM_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no 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: Yeqi Fu Resource release is needed on the error handling branch to prevent memory leak. Fix this by adding kfree to the error handling branch. Signed-off-by: Yeqi Fu --- drivers/scsi/fcoe/fcoe.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c index 44ca6110213c..dbc202f2f05a 100644 --- a/drivers/scsi/fcoe/fcoe.c +++ b/drivers/scsi/fcoe/fcoe.c @@ -829,6 +829,7 @@ static void fcoe_fdmi_info(struct fc_lport *lport, struct net_device *netdev) if (rc) { printk(KERN_INFO "fcoe: Failed to retrieve FDMI " "information from netdev.\n"); + kfree(fdmi); return; } -- 2.30.2