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 6643C2D0602; Thu, 30 Jul 2026 15:58:24 +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=1785427105; cv=none; b=m9DCedOZ+PBTAcLDCzLCjUAizLzIOpzB+dHAgL7HjqaqtN1gwTm8z1QyHsJG+JhvPi0agcKBQQrZ5K/67+Yv+1JFUHNYwErzgMD/rJns8JvlGlxkR1bGbeulOu/d8Ph6JnNwttRYPvZvyKoRrUFzOLliCmJhgHOPVwXRXmenmME= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785427105; c=relaxed/simple; bh=kQvBunnxSzVFVmpCc4nURpl56/2UJn3EINWQzZ2ihmo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=C6FNG5pRos6JrRxuLZhN4VaopavCzvCXjVyvuBs+p5BZnRm4IzyhW2+JdqTpvzxvnDUfPCvYpjk4vh7RqllbN+3Uu14by3d78bo35GhmjzBclVgkwKe68AcNqaKiqCb9VtooCfuv+MplJ6pHgzcV2fCUhBKlgu+FCaiseM7epi4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=BfzP76Qk; 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="BfzP76Qk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C2CA01F000E9; Thu, 30 Jul 2026 15:58:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1785427104; bh=g+luCRhg4hPsKKgDtZODiniYhn5dmvNPd9DjQHLq0Jc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=BfzP76QkcfMcJ+pV7ZJLUnAqwylH6rKvge8B01WIDKr1nOiVCDsjwlOjLFb+UFGPa jIBB4b/sWUgNBIZoNK/LRZus0na3CztMQLC8294h/3W68Y/u42Tr8vyWHvyHOTrNbU PKte1B8vPKNRYKKpHhLDXU3AuBE0nK0R4UnHbr3Y= 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 6.6 054/484] wifi: ipw2100: fix potential memory leak in ipw2100_pci_init_one() Date: Thu, 30 Jul 2026 16:09:11 +0200 Message-ID: <20260730141424.601831017@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260730141423.392222816@linuxfoundation.org> References: <20260730141423.392222816@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 6.6-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 9e9ff0cb724cac..a1eb69efecc6d1 100644 --- a/drivers/net/wireless/intel/ipw2x00/ipw2100.c +++ b/drivers/net/wireless/intel/ipw2x00/ipw2100.c @@ -6172,6 +6172,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; } @@ -6184,16 +6186,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