From patchwork Sun Dec 18 18:08:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 34328 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp2024591wrn; Sun, 18 Dec 2022 10:31:24 -0800 (PST) X-Google-Smtp-Source: AMrXdXuVMPh6ZfhKaqEv+1vDSAHRvRmOjTRqmsxrzy4OceIHjiAuDM3dNTAzcJoxA5k3CgXHp0ly X-Received: by 2002:a17:902:7d8e:b0:189:efe7:df8d with SMTP id a14-20020a1709027d8e00b00189efe7df8dmr1884997plm.43.1671388284032; Sun, 18 Dec 2022 10:31:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671388284; cv=none; d=google.com; s=arc-20160816; b=XzejFt1cdAqcUkrbal2ruYxz3/8gtZYUr5BL3WC7BASG6d2H2De0y/SCkaDwYE71VS YlS4gjj5M7LRSZQ8ZFfIzYhjzA6XktXxybyibECWG8oSt2LvJ/HdG4FneiJuu5uInInB ph0buQhNDoG23lmZnoBPRd2SFb2vZ+hJk/4LBCJA0jcKb9XZtoOq8gzFBcjqyEzQAiTy WTte7/2pkO7EW94ivPeo5fo+ci6kCmlPcUSQ1B1JSLJIj+yzEpe4LO2k4Oye9lvnlw67 i0bF+lUUIhuyoJ9u4+lpsr7SRQFkOycJ1svQ35Ex9iUCaA35nVpiPCbfpxt9Mf8vS/Ar DbDQ== 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; bh=pIJjJ+Vq4ox+OMYwaQamvcS6Dsa1ibr1wrVSb8M9XX0=; b=B08VWPLp5WXZVKIf3PwrXhhYjsOhKqd8IXZ/Ur56nKz6lmJUfHv6H0NEtOz7EKAlCb BpGL069it3J9EWsAjahm0eYkBZFdFziAbCFCOYebZGREJIYZV0DPUXMgFOox26Z2M4vk dp9lf5oGZ1YGchHJzzsZcRgIPOcRGRfrTo3VAZnf8qkfk3rZ7l6lSHag2wSgUjuBDrG7 YMl7+2MhMkjbmNIQ1cCAgCN8fG/VX5VmiiCz9VsmI1bV4cdgsKH7grwiFMOwz8Zufq+k rqfS4Wnb2oUtK1GvazaCdsMNLmIRLi93E/91Kw6ku99TZ/aNQuEW52ZwzflOrwLnuf79 tbWg== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jw12-20020a170903278c00b0018731d9aabbsi5824799plb.497.2022.12.18.10.31.11; Sun, 18 Dec 2022 10:31:24 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231153AbiLRSaT (ORCPT + 99 others); Sun, 18 Dec 2022 13:30:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231199AbiLRS3e (ORCPT ); Sun, 18 Dec 2022 13:29:34 -0500 Received: from smtp.smtpout.orange.fr (smtp-26.smtpout.orange.fr [80.12.242.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D56CCE9E for ; Sun, 18 Dec 2022 10:08:51 -0800 (PST) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id 6y5fpvYLi8ao36y5fpZW7m; Sun, 18 Dec 2022 19:08:49 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 18 Dec 2022 19:08:49 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET To: Chris Lee , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Gallatin , Brice Goglin , Jeff Garzik Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , netdev@vger.kernel.org Subject: [PATCH] myri10ge: Fix an error handling path in myri10ge_probe() Date: Sun, 18 Dec 2022 19:08:40 +0100 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752577641675492815?= X-GMAIL-MSGID: =?utf-8?q?1752577641675492815?= Some memory allocated in myri10ge_probe_slices() is not released in the error handling path of myri10ge_probe(). Add the corresponding kfree(), as already done in the remove function. Fixes: 0dcffac1a329 ("myri10ge: add multislices support") Signed-off-by: Christophe JAILLET --- drivers/net/ethernet/myricom/myri10ge/myri10ge.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c index 8073d7a90a26..c5687d94ea88 100644 --- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c +++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c @@ -3912,6 +3912,7 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) myri10ge_free_slices(mgp); abort_with_firmware: + kfree(mgp->msix_vectors); myri10ge_dummy_rdma(mgp, 0); abort_with_ioremap: