Received: by 2002:ab2:3c46:0:b0:1f5:f2ab:c469 with SMTP id x6csp6709lqf; Thu, 25 Apr 2024 19:22:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCULFdmpwtzf5imYIxFDEe9PBt4gMHQgPYTKnvNuLudCbHGcDRBE37ghUqzWAwZPJkzKNBPso0UVQ90pdhnCNTlXv49r+gnVmAuERGEQtQ== X-Google-Smtp-Source: AGHT+IE4emJ4m2TQlSn5v+giPFGEaP3EmkbM0nYM5Gza1mcifwpzIgI9COe9OrTNWA2rFwe2f8mj X-Received: by 2002:a17:90a:5c82:b0:2ad:4321:5bd3 with SMTP id r2-20020a17090a5c8200b002ad43215bd3mr1474151pji.15.1714098161439; Thu, 25 Apr 2024 19:22:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714098161; cv=pass; d=google.com; s=arc-20160816; b=dU/OqpC7qsjXbjyGKZVttpjjPi2uvNTml0tdB7e8him96QWTM7U42NRvXULDirK6nI nll8Q0cEoT09qC0jUE/PbwlNVsLfwnXigdrfcZACrhoj4G/33EoDlCffAveS3e3YauOu cz4c3nMkI23ivJ/ymGrD9q5lSFSe87yGTRtyaMTfSTRIjmcT7ebw58No9Pb51EZJKMUi CXrvwkjNOR1NsTOGxg0g7Tgf/3Za4uPq4OvzOuh+gV/Yf2x57HKHgI+eNrzqcYkoLfpo CnVgd318C+zZ3F7Os+KIwagzzvF8n3olbgEz6fwZm71XTKhf8a/nqgrxGNF518zMvIqF QeIg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=W+llEiqHYcicbi/eAfa58Zpn06ur3WDHgrUuuzURwcs=; fh=KUZSexWo0TEbkAFVsCpx/6m6nmUhPOs2V/K5xGN4rLU=; b=U90I9VMhzAn86s0ahg0GjXAlXPqGiwdx/38dGatoFqlaxaYFiuVQcJJKVWUy1r9/gr MtpWFXuRoD673GghgxiQjy054Z+OsajK2FJA3H9+gyfXOo1hS0L7/4UkIUF60RnHlk7o pE1ZAAoo6iAyJyBHfCVfJrfckzlzVzjqg91NZ1MyIfztXEFSusBLtPS1uoyd5HyV43yT aOYa3u+SVHQa0r+nvQGDuA9s+2bqHo9q2BqRXbfg/Ioi9h2kGLGQ8+Z2CImG2bI3MiPC su7yc6LFAntNt+jE01rfidrU5758rW0DFlEAzc73AcMc9FB/K07EMSzTDTUCINhz3E6e mgJQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@126.com header.s=s110527 header.b=G6kmxnNS; arc=pass (i=1 spf=pass spfdomain=126.com dkim=pass dkdomain=126.com dmarc=pass fromdomain=126.com); spf=pass (google.com: domain of linux-kernel+bounces-159440-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159440-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=126.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id hk15-20020a17090b224f00b002af739dceebsi3509367pjb.11.2024.04.25.19.22.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 19:22:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-159440-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@126.com header.s=s110527 header.b=G6kmxnNS; arc=pass (i=1 spf=pass spfdomain=126.com dkim=pass dkdomain=126.com dmarc=pass fromdomain=126.com); spf=pass (google.com: domain of linux-kernel+bounces-159440-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159440-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=126.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 6FC78B231CC for ; Fri, 26 Apr 2024 02:22:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 901354685; Fri, 26 Apr 2024 02:22:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=126.com header.i=@126.com header.b="G6kmxnNS" Received: from m16.mail.126.com (m16.mail.126.com [220.197.31.6]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E8D1BB642; Fri, 26 Apr 2024 02:22:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=220.197.31.6 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714098125; cv=none; b=IfYUMZ1ET1LtsS8dgdDtvoCLdDFTNhdcV1kN4Mj/di6jdDrNeZ47A9Mp/XBJH4ZrFPcEJ+EObgEfNIcZT5+XMG394GBN+cumcJs1Y/GzhLu2T0EjED+4piI9hcoGUwU+MR/qijZn8zp0IUKfzddc5r9/d9NGYR+S7vH0UFWjOyU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714098125; c=relaxed/simple; bh=XXS/DqzOUd2pZXmZfdeWQlXnvZ4h6TO847RjqihLfV0=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=PWgQDs/FXQUClgAnkGOdbcyOgSlw7MPWNnMHNhHuEBN05wUEFbCGRhaN7eplx/sq7xD9y05udJ3dGXdUWSiERsUekIqKRvWB/6dXGi0ZYAreFD6rlMAtv2x8unZMTojQ2Hq4CMClsXMzYME4CaY1uf4X0gApXoK4ggnkd2uCvyw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=126.com; spf=pass smtp.mailfrom=126.com; dkim=pass (1024-bit key) header.d=126.com header.i=@126.com header.b=G6kmxnNS; arc=none smtp.client-ip=220.197.31.6 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=126.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=126.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=W+llE iqHYcicbi/eAfa58Zpn06ur3WDHgrUuuzURwcs=; b=G6kmxnNScC5OKeEvYCRxJ 6RtO1bCZAee5jvKaXiQDcM2Zy7mfmOyWlNgvH57ND3Cb5rFX9nqvMgc64ONgt1Gp vkzjz1UiJqsDhCJkGnsMXu+9I9wv0flIET2qVR3xehB/taVR21vYs2LC9rkoXK2I e6PbPGXU5e06tDyyU6lHlY= Received: from localhost.localdomain (unknown [111.198.54.11]) by gzga-smtp-mta-g0-1 (Coremail) with SMTP id _____wDnL+I9DytmkXXvAQ--.21672S2; Fri, 26 Apr 2024 10:19:47 +0800 (CST) From: lumingyindetect@126.com To: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Cc: ilpo.jarvinen@linux.intel.com, andriy.shevchenko@linux.intel.com, gregkh@linuxfoundation.org, jirislaby@kernel.org, LuMingYin <11570291+yin-luming@user.noreply.gitee.com> Subject: [PATCH] "drivers:Fixed memory leak in /linux/drivers/tty/serial/8250/8250_lpss.c file. Date: Fri, 26 Apr 2024 03:19:39 +0100 Message-Id: <20240426021939.1083521-1-lumingyindetect@126.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID:_____wDnL+I9DytmkXXvAQ--.21672S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7CFWDKF4xXFW5WF4kArykGrg_yoW8GF4UpF sxtFsIyFyYqa4Ig3Wjyr4qqF1Y9FZ2ya47WrZrGwnI9rZIyF93tF4rtFySyF1UXrWktF9F yF48Ca1jya4UJFDanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jK-erUUUUU= X-CM-SenderInfo: poxpx0hj1l0vphwhu3a6rslhhfrp/1tbiEATM9mVLbE9NvgAAsQ From: LuMingYin <11570291+yin-luming@user.noreply.gitee.com> In the lpss8250_probe function in the file /linux/drivers/tty/serial/8250/8250_lpss.c, there were certain return paths where pci_free_irq_vectors was not called to release memory related to pdev, leading to a memory leak. This commit fixes that issue." Signed-off-by: LuMingYin <11570291+yin-luming@user.noreply.gitee.com> --- drivers/tty/serial/8250/8250_lpss.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/8250/8250_lpss.c b/drivers/tty/serial/8250/8250_lpss.c index 776ec1ef29d6..2bb86f9cad5b 100644 --- a/drivers/tty/serial/8250/8250_lpss.c +++ b/drivers/tty/serial/8250/8250_lpss.c @@ -344,11 +344,11 @@ static int lpss8250_probe(struct pci_dev *pdev, const struct pci_device_id *id) uart.port.mapbase = pci_resource_start(pdev, 0); uart.port.membase = pcim_iomap(pdev, 0, 0); if (!uart.port.membase) - return -ENOMEM; + goto early_err_exit; ret = lpss->board->setup(lpss, &uart.port); if (ret) - return ret; + goto early_err_exit; dw8250_setup_port(&uart.port); @@ -367,6 +367,7 @@ static int lpss8250_probe(struct pci_dev *pdev, const struct pci_device_id *id) err_exit: lpss->board->exit(lpss); +early_err_exit: pci_free_irq_vectors(pdev); return ret; } -- 2.25.1