From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 412673B4417; Mon, 17 Aug 2026 14:03:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786975408; cv=none; b=nxCxpkmmpSoedAM2QNLnSvhg9FMVZ0st8hPP5Tfzgo10ONnj5h/j+gedVHCihoswmjCdt8BMrnXyeCo/ByPa/CzOYuXy1zfSjwIhOxPH/Qo5a02Xe5JTBXtg1ZmM6pg0tGu7beFn7JrAQy97Ig8x0SFZ3clUyBsbuLBg+mgIZbY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786975408; c=relaxed/simple; bh=4bOk3EXgg6jOpZWv+ykrImgzD+H9KnindO0bT4sHlFE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=agVsdWts6XWmwv9yh9UQexmSaFeFyEqdn2PHMQE09sROh9Sij/c0032Tswj3YHyYhmp1EKWBk2M4HvA9Av/heZTv+A7/C4pIPMn1nGBT4aKhSa+2eOYt1eEQgBBPQeghQR2gLZO7LvCUCxLmLABgZISdWQb/VX2RwcgkSoE/FKY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=fJj//0MD; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="fJj//0MD" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9970F1F000E9; Mon, 17 Aug 2026 14:03:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1786975407; bh=71UIOyJRUVQEAuBp8OmugmYf2C3TjbTbPGbCcNC4pTg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=fJj//0MD/4gfOshsqYL0Dwk7O11mY9dv1rKrp27W+Boa33fLMKIbimTWu5hm/Ahci gw2XIgvZ27dUfT5sNj0vyzTXqnUkkfgV38dddSVSB3kkTaHOHf2yK9MPEea2/s0fi4 LepgDBaS+YjIehrG61z2PcKxb7+no6K9HMwIVoTk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Abdun Nihaal , Johannes Berg , Sasha Levin Subject: [PATCH 5.10 018/389] wifi: ipw2100: fix potential memory leak in ipw2100_pci_init_one() Date: Mon, 17 Aug 2026 15:27:37 +0200 Message-ID: <20260817132539.586432010@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260817132538.796021292@linuxfoundation.org> References: <20260817132538.796021292@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Abdun Nihaal [ Upstream commit 0d388f62031dbabcba0f44bb91b59f10e88cac17 ] The memory allocated in the ipw2100_alloc_device() function is not freed in some of the error paths in ipw2100_pci_init_one(). Fix that by converting the direct return into a goto to the error path return. The error path when pci_enable_device() fails cannot jump to fail, since at this point priv is not set, so perform error handling inline. Fixes: 2c86c275015c ("Add ipw2100 wireless driver.") Signed-off-by: Abdun Nihaal Link: https://patch.msgid.link/20260620065242.93798-1-nihaal@cse.iitm.ac.in Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- drivers/net/wireless/intel/ipw2x00/ipw2100.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/intel/ipw2x00/ipw2100.c b/drivers/net/wireless/intel/ipw2x00/ipw2100.c index 23fbddd0c1f8e0..a46ecfa07ba2b9 100644 --- a/drivers/net/wireless/intel/ipw2x00/ipw2100.c +++ b/drivers/net/wireless/intel/ipw2x00/ipw2100.c @@ -6183,6 +6183,8 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev, if (err) { printk(KERN_WARNING DRV_NAME "Error calling pci_enable_device.\n"); + free_libipw(dev, 0); + pci_iounmap(pci_dev, ioaddr); return err; } @@ -6195,16 +6197,14 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev, if (err) { printk(KERN_WARNING DRV_NAME "Error calling pci_set_dma_mask.\n"); - pci_disable_device(pci_dev); - return err; + goto fail; } err = pci_request_regions(pci_dev, DRV_NAME); if (err) { printk(KERN_WARNING DRV_NAME "Error calling pci_request_regions.\n"); - pci_disable_device(pci_dev); - return err; + goto fail; } /* We disable the RETRY_TIMEOUT register (0x41) to keep -- 2.53.0