From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 934963F8229 for ; Mon, 27 Jul 2026 11:03:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785150198; cv=none; b=eP2wrX56dUopd0puS8LcoMWvo19EgpuUpDmZS8RV864/yVRXoOVGcBOPFg4yEN+ReTTbbzUk7s7R6WuKEzqeCJETKDLR+H53XbDdt3LAuwgwr9EFIF64G6tkc9agKyt7vJ78dA7c1Y7gvDtKPHicnCcmYkdJG8omqcs/9tpWOwI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785150198; c=relaxed/simple; bh=d6/Bvf25CGCgs9lZIjHl0TVlUBqYcERKJNX6lqIImaA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=QV978ociZAzc0Qq4xeYLeM+BDei31y61VqNXuVxLtX9auf683/M4dS2ZhmMoeDBBXuH87VAWdxxI5rgbelL3/3PQ9EZE5lSCe8en7dcNxrxyGqpnXocZx+WeWloxypCDVoqNDPMKueK9k/3DADfyMNBqb0a4xS8hCMwMni7cB5U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=CxVptfrZ; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=LNFwT6pB; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="CxVptfrZ"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="LNFwT6pB" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66RAM8Te3322319 for ; Mon, 27 Jul 2026 11:03:16 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= bjyL0Mx5mA+obZ8zFCVX1dDW0MXrzq9zNvV5dazhMBw=; b=CxVptfrZdQjtypIj o8sMsvorVXKB/i3gC2hOejcax2LYHU9L3KQI1N0oTvW6oCn21GQ9GJJfVDeoSmSy /BSAyas86Wja5ACd+E/2atlt9FYKI10JohbyyMcxTSF1rG4urxJ6bysLlv9+Yzbc 3ll8Vm+bsNAh0VJZWeB0wTmIvupp1a8yzFn7TPmHRn726Y3OMdye2YlcENlzLjXj eM9YmJPARmSwaHD+qK7GNG0rTsq/6axBOq3y8+x9GNtE0JwuGGUAIHUoMOy44nnG t7IsoD7o0XQlec2PZ1kDgYJa/coaXT9/0eaJ3JminwBNMpuxV4LY5IPBkuKysZy6 zYzncA== Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fp3v2gkp2-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 27 Jul 2026 11:03:16 +0000 (GMT) Received: by mail-pg1-f200.google.com with SMTP id 41be03b00d2f7-cb6cf425e86so3298385a12.1 for ; Mon, 27 Jul 2026 04:03:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1785150195; x=1785754995; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:content-language :from:references:cc:to:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to:content-type; bh=bjyL0Mx5mA+obZ8zFCVX1dDW0MXrzq9zNvV5dazhMBw=; b=LNFwT6pB+/zd3CZygRSblnJC685ZmbwZM068QajmIm3/EOb13grlWs1tyGdussq53x PvhNmV4pw6En992gDKkWDHVHZabfxPW9EtQuJHZRwG2+4zrqBkfNwciiLFAVR2tjXzOj 0ny/JAu4cBO1m9sX6UovZ7ihRPRHSMST3STgRe/5+YJBP8Po9V/BG2NOv2hDebkbzx9v incdnTqLBKjH0s5m/SoOzme5XlMo8/xwbsQqOYjd9jBQ6SivOzulYzRzNeN/92IJ2rKI AuvlxjnV5Xp9sWRTVUpF2EeaUCVblSNjQVX4CyXzNHS8CsQCJVejffh7ZXXsr5S9m4QK R0Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785150195; x=1785754995; h=content-transfer-encoding:content-type:in-reply-to:content-language :from:references:cc:to:subject:user-agent:mime-version:date :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=bjyL0Mx5mA+obZ8zFCVX1dDW0MXrzq9zNvV5dazhMBw=; b=XhGb1Mrh4GQO47nJ98CTZnxyTdAeXWttR/79ZVQwNjTklMeDvI3owbLa8+YnWLc6dp RJldjlZ1lljTagSSfXZwXaugco1aCgeO9wWn+GNoChTNmA7Xjhx9flSIdQEsjtrNTaPK IcA3TpjXQT5APSaCygnTbG6rmhAWjy0klBdveX/5Ny2lK0krX7TfVcES+BnUCLcblJSw AoK4Q4op4ZUd0PxtLZ/gydfKXuDY7eR7s49ATUcEBBzbtmKpF3HckoAIADwbm3ymY1UI ddU7RG+mdQ8cRvUHOjhcoyFCye4Dd2XzuhsnVR2AQm7fFe4QyQuzMlR0WTDpO8Odzm0c 1wdw== X-Forwarded-Encrypted: i=1; AHgh+RpbzCMrrvD93fXN1oSjYQH9TENqTcsdKlGCQ8ZXKnw5+ESyWBByZlnmjqthp+ABRkFfb3AJYKjYFnSTHP8=@vger.kernel.org X-Gm-Message-State: AOJu0YzSmfdcEdVIWZgW1oyXjV+1lyjc3F3/E8TSxB+jFwPlvyUCCzAn NfO7ULLm3FprOKZaTC3Cg1jTLmzoHtEyK93DPTA1faEpYYTdW9ENaPzTVU0buIdIr8OYxLt4gN9 iilkZu7n73jk857WGOvdzh46d0QaPah4E1TO9j5VI5l9TOtLtxF1DwLSx5Ki/ISlyLZ8= X-Gm-Gg: AR+sD11fxqdUk/KF4bUmDGXyjoFi7hhnuQXlMkvGOO397e5Yx3t53nNB0Ams5tqCYp4 XoHPhfJin918VhNLLGu31Xy8Bf7MjLR+2Jf0yfXbI4D6U7ass8ajChUKXTmFgZRWtVfUEiOZy1Q ltqgc4L7oXi5iFiwHO3NZrEovOSW3XCJaF00vizHU8EY/aREewE2SwC1k/1vJof/i7K0EfIfjAF OwsFPx0HL1CGZuvX2rp0Sf+FXRXKMBnrDv7N9PmoK6FvX/VHRh1Lte9ng9XM9u5G2K4ETusgYV0 VYXlxHBwYEHbrmvX4/a09T+x5QYOx76z3b+dNSqdROOogRg2pKNwC7kGqEpryuxtNRcUNgoZm+u uydntOkURrRIZGwLGS5lQ/nlP0HRwpDyACCUv/J5b X-Received: by 2002:a05:6a20:43ac:b0:3b3:2703:115 with SMTP id adf61e73a8af0-3c67dc41ae3mr7496094637.16.1785150195103; Mon, 27 Jul 2026 04:03:15 -0700 (PDT) X-Received: by 2002:a05:6a20:43ac:b0:3b3:2703:115 with SMTP id adf61e73a8af0-3c67dc41ae3mr7496058637.16.1785150194687; Mon, 27 Jul 2026 04:03:14 -0700 (PDT) Received: from [10.152.199.23] ([202.46.23.19]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-314bc413766sm32063360eec.8.2026.07.27.04.03.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Jul 2026 04:03:14 -0700 (PDT) Message-ID: <70a367c3-f520-46d7-85f3-d7470f3c16e5@oss.qualcomm.com> Date: Mon, 27 Jul 2026 16:33:08 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v6] wifi: ath11k: fix resource leak on error in ext IRQ setup To: ZhaoJinming , jeff.johnson@oss.qualcomm.com, baochen.qiang@oss.qualcomm.com Cc: ath11k@lists.infradead.org, jjohnson@kernel.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org References: <20260727065500.3827035-1-zhaojinming@uniontech.com> From: Rameshkumar Sundaram Content-Language: en-US In-Reply-To: <20260727065500.3827035-1-zhaojinming@uniontech.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI3MDEwOCBTYWx0ZWRfX8VAJ7Ij0jqIS 23aThucg7s4ERyQ5DQxIxy/grf/Bdr408Y/cUHT9aRoXWY6EvPg3TVpq4ppy1z5BphGZQSVUlXU AeRCDmJVMkrtOnIIucfwFFhkmSsCu24= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI3MDEwOCBTYWx0ZWRfX9pAk+Mqv/XCU wtRgDKsK1/vOeZ2ta/4rgMAvavZgLRxyT11i65cnopE9hMch9kfd8med52IaHltfpkGFCnlEz1z OxtNzMrZj35JBtke3odMvaubRaijb7tLD8BujXxedBn1SYhssTxSxbjBc4gKxATVmwQ3PUkD7Mw VuGmMcZ18RlOV+8O/nMS5uYFxaJzrkOzxLxs8fERgoz6RoIDMGOzx6z57aV/hreNX/v6LzoiKTN U5AV0p1gASt5S3AQKH8jQmB+9FZVs9eRkoWPrwOvrASYnZEvMx6H0MAcwqCbvlH6PHacjU+j/lA dCdNpb68pNByvGUd7BweJsSM2AXcyX6XqbQCtHwZNMKhgDmuNb5WlY/KVKl8GYFg+ZZTMhpbQWx 0JNCciqliB1k/MNzr2xXs/RLcajj+Vodd+sitd2AaxYXwAZ67gZuywZkdWlpjWpLI+naId/DUdp 64TrMR5cTJ1Iiyl589Q== X-Proofpoint-GUID: L4N3ssFg8IT-wl9EvwHGf-cagZChD9PX X-Authority-Analysis: v=2.4 cv=KJ9qylFo c=1 sm=1 tr=0 ts=6a673af4 cx=c_pps a=oF/VQ+ItUULfLr/lQ2/icg==:117 a=j4ogTh8yFefVWWEFDRgCtg==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=iHwBjlyiAAAA:8 a=EUspDBNiAAAA:8 a=t70t56v2sCmPkK01i0IA:9 a=QEXdDO2ut3YA:10 a=3WC7DwWrALyhR5TkjVHa:22 a=uNSKXYNwxGiU6LD0JREI:22 X-Proofpoint-ORIG-GUID: L4N3ssFg8IT-wl9EvwHGf-cagZChD9PX X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-27_03,2026-07-24_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 impostorscore=0 malwarescore=0 clxscore=1015 lowpriorityscore=0 phishscore=0 priorityscore=1501 suspectscore=0 bulkscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607270108 On 7/27/2026 12:25 PM, ZhaoJinming wrote: > In ath11k_ahb_config_irq(), when a CE request_irq() fails, the function > returns the error immediately without freeing the CE IRQs that were > successfully registered in previous loop iterations. The probe error > path does not call ath11k_ahb_free_irq() either, so the previously > registered CE IRQ handlers remain attached to the interrupt lines and > are never released. > > In ath11k_ahb_config_ext_irq(), when an external request_irq() fails, > the error is only logged and the loop continues. The function then > returns 0 indicating success, leaving the device in a partially > configured state where some external IRQs are not registered. This > causes enable_irq()/disable_irq()/free_irq() to be called on > unregistered IRQs during runtime and remove/shutdown, triggering > WARN_ON(!desc->action), and missing interrupt handlers lead to data > loss. > > Additionally, if alloc_netdev_dummy() fails for a later IRQ group, the > function returns -ENOMEM without freeing the ext IRQs and napi_ndev > that were successfully set up for earlier groups. > > Fix all three issues: propagate the error up to the caller and unwind > all successfully registered IRQs and allocated resources on failure. > Also move ab->irq_num[irq_idx] assignment after request_irq() succeeds > in the ext IRQ path to match the CE IRQ path and avoid storing a stale > IRQ number on failure. > > Signed-off-by: ZhaoJinming Reviewed-by: Rameshkumar Sundaram