Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp912342ybt; Tue, 7 Jul 2020 03:23:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwi2rad+iBMoa8fDMeN8uvn4/sOKv4YYpMTP3BoK173zBC0NbkLIuWowigvuH85VbgJsFOZ X-Received: by 2002:a17:907:395:: with SMTP id ss21mr46450695ejb.181.1594117422889; Tue, 07 Jul 2020 03:23:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594117422; cv=none; d=google.com; s=arc-20160816; b=uDAHgw4ByknX9qo7Cx9Fny1EX6aY7fRbX5h1g/OQWYNjsv8K+Yk3KYeJSZ7nvV/OqR c057KfWyWW/615q/ulXFDfJQU4jv6CLpZQAJ27gxFmNZ0mpbMQjjn8ytmk2Ipu6BzSPY zyEHBSUWULNBOe0AaGzXFBmZbsCGpsA+ktMxvPXneny5q7ja0NSQ8+Ss3QAe6ChaegUO IBkEx75Zo3oUefvYvp5s4/bt9pMd7ZWSkY4DnmQF5SNmBJiwuKFLFQsaGUHtzmFR89LV 8MAHzCUQbqdcPLZmR7UuTI21JFRGtB86Yewr982/MbtHyIfK6mZgGUxMCU4FHR9LOLqL p3jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Iul9OUUrzW9MtLMqO9rJsIS0wL8v+6NBHEnFBbpYRbY=; b=iTcTM5TLmHazVhmHg54f4J3z/H3g41cKvDjxkWlWiJxGMB/xHDpuiYEczAcylYZy1T D3TYt16vZ2VI4sq1g7G8dMMMKgs/KnlFEN6whrXYxZWn28yfT0+pU+qs6keRXsm/9Kyb DyTR4kFCQoiXyMFRdEfzLbN6dMU/MzOnuL5rERnVJCRXoStuRLNtGmaYVKjwbgWBw1TZ LqoOOxhyWX41g1r/SyrJGoiaybA3x5+3Se8wYAn19lPH3+3uDdTH2tDU2opO3yBMp+mF 1oMAbJJFxIp+PE/UKJpwpPxQsnzYj1zOczhmh+2utekFoKcMTkFKHTN8UJgMjYvTwRg9 mTfg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id df18si15188036edb.501.2020.07.07.03.23.18; Tue, 07 Jul 2020 03:23:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728266AbgGGKVG (ORCPT + 99 others); Tue, 7 Jul 2020 06:21:06 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:7262 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727936AbgGGKUn (ORCPT ); Tue, 7 Jul 2020 06:20:43 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 7BD35A78D68840B548BE; Tue, 7 Jul 2020 18:20:34 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.487.0; Tue, 7 Jul 2020 18:20:24 +0800 From: Jing Xiangfeng To: , , , , CC: , , Subject: [PATCH] scsi: fcoe: add missed kfree() in an error path Date: Tue, 7 Jul 2020 18:24:31 +0800 Message-ID: <20200707102431.178675-1-jingxiangfeng@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org fcoe_fdmi_info() misses to call kfree() in an error path. Add the missed function call to fix it. Fixes: f07d46bbc9ba ("fcoe: Fix smatch warning in fcoe_fdmi_info function") Signed-off-by: Jing Xiangfeng --- 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 25dae9f0b205..976f70cbe043 100644 --- a/drivers/scsi/fcoe/fcoe.c +++ b/drivers/scsi/fcoe/fcoe.c @@ -830,6 +830,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.17.1