Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2673567rdb; Mon, 5 Feb 2024 14:03:47 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX+WqJVMPmxHm9P9ma1Jp6IJqQu/DGDir8Y07fRj3MaK8+QNIEBY0TQXh7SIAYe3bc/q0QlWQUbxyyGEBnA08mcLSJwusdiw3agmTlVvw== X-Google-Smtp-Source: AGHT+IFV/eygO4pw8CH7vRCVqn/OQLCoP0rQHFOXOEYLY0Y+kwanF4ycxB7OJ5Cx0uiwkKjAkxCg X-Received: by 2002:a17:903:2302:b0:1d9:b3ea:25ef with SMTP id d2-20020a170903230200b001d9b3ea25efmr1092579plh.10.1707170626808; Mon, 05 Feb 2024 14:03:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707170626; cv=pass; d=google.com; s=arc-20160816; b=pP12XIlxkpAdKhljFOPH4+TJEj6T0KJb/a1lP1n2BPuOmGkFws7EVCK2AU4gyO8rSo jAXB1Wx1rrJol8oEV5KAPymsJfkflz54+OR1xHDCAdf6YneyD+zo0w+EA8WAqsQNxxuU PggAP+BLHlinpU1NLmg/6BjjVPkHkMxMtU5iOqk2SbLmQSAshq+X8gEP6Mr7rwPrTkOA ToefMUgAJDf4KSFo4p8NWwh+JJx/DM4qusKcw1HYVZduvG+LWSBoAl8f0ZwVDqLhLwyS rSmOQhAr6zEXbSV2/qYpjkkElwJcCwACvEVXrRCK99561y2Jpe6m1SPP4ai2fF9oKnrf N9Tg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=+GazEYcOfj78Iv0+lnmZ8xLRg78Ggjpx3nxYAAFeqvU=; fh=/4RBoDMJ3g93+epTMR9DSmX7sP924RKx9JN0zbRJHSc=; b=Mwa2Yh1GzUxQ4xrqbrfFueB7ZThROEpedR3m9M9idMFKCs0gPo78WuAjxOT04AmBNc 8FNpnylRhdvtud6BR8zo8tWkXzIypInOJHltydAmMufW/tBKoS/RWDEmzgTcZl4BCyf9 TFUyN3XfIRnAnElJ/hazeSeiJ/yue6NfV30YammqM+AF2Qw/qVtXUB8d36ddS2uY4gPW xDdYNN5E3cN/T+5UGc49/ZqdCmhWhIMAd/IS6DdRsRrgDF1e+HIQ328KNVJVqPJsCEXO LY9PVxVFdXs495THNLkfSzKOfaVeDqIUns0UB9YryS9PENr2rS9yQg+5slRekEx8B5Dt Bdpg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=LstfVTsF; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-wireless+bounces-3180-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3180-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com X-Forwarded-Encrypted: i=1; AJvYcCVYWw0p1D41G0RV9hG6VXDq9hdPuikhwd4Dw2aEAxXZ/ww3HS+p3z3CRbQNiXrrSsMyeRYDzHkV34Fcx16cmJ0VuisDE89dv0J8L1l+Yw== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 17-20020a170902ee5100b001d9d3b636c2si430540plo.633.2024.02.05.14.03.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 14:03:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-3180-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=LstfVTsF; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-wireless+bounces-3180-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3180-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 321B928C295 for ; Mon, 5 Feb 2024 21:54:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1BB901386C8; Mon, 5 Feb 2024 20:51:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="LstfVTsF" X-Original-To: linux-wireless@vger.kernel.org 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 ABA601386BC; Mon, 5 Feb 2024 20:51:01 +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=1707166266; cv=none; b=mkIiUkDcrHKHExDbF0pbAnOkoVfZw2VasB5i9xV6PTGhFNCvb0C+feYGHXaE05lwkt6uLX0rGa0iMCxToShyDuey6ATzDfVsVY885E3kgrpkygNu3zPG+aodVINf5xlKqrkcPZH33NoZl2RsCxWNJZk5qRz2PqXIcA1Lasm2CXQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707166266; c=relaxed/simple; bh=vQirxtGuigMN/0Rn0eLAvFQzJ+WGBoW9ePK4iBJJ/OY=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=qPVE0gzfW8ZmNR6++4UR4gNxqH/nf+86YprQg8fewPlr+kkKCqhclZ+Xk2u45w2tJA9k0kT0r0/MxAYbg+DFgvmtaXImpu3tgTW+WAwkUWkprtHqh/QYBv3TdHXu2JVawqdAUW0hdEXUS5Efs5P1EugLhotLX2uBhRZvp3sGn3k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=LstfVTsF; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 415Kgjrg013057; Mon, 5 Feb 2024 20:50:51 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=+GazEYcOfj78Iv0+lnmZ8xLRg78Ggjpx3nxYAAFeqvU=; b=Ls tfVTsFCedBpR3yoAmG6F45iw8P02Rf3jbtEpYPKArRpYFnMDkqi+RKrAe6RFhdOF 13G32h4rzsNdOOhL0KveFLGJzpTI+NO5HixU3gaOxUfjR689uCXVSFRn2BawTwfc CImh0kGSRnvGxr7fciTCLP2y2Gmadc1VGqjJwpGe+HE5P1r/Smh0Js/etSMrKVpM e1dQKhl4vMLil/c/TtFndT3Lid4h1u74SCDRHRt99Eq8+lOhBUzlyQ8ASjdO9t6R vVn9M0Yf0F637S/wMG4tXrhDjzYQf6GeUN7MhOsVZ0lyhNQRZ5QaO3mxJEYqWsRg C6XeAWiQMkHslaYyPVvw== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3w2v729pba-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 05 Feb 2024 20:50:51 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 415KooVE008944 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 5 Feb 2024 20:50:50 GMT Received: from [10.110.62.200] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Mon, 5 Feb 2024 12:50:49 -0800 Message-ID: Date: Mon, 5 Feb 2024 12:50:48 -0800 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] wifi: ath12k: Fix uninitialized use of ret in ath12k_mac_allocate() Content-Language: en-US To: Nathan Chancellor , CC: , , , , , , References: <20240205-ath12k-mac-wuninitialized-v1-1-3fda7b17357f@kernel.org> From: Jeff Johnson In-Reply-To: <20240205-ath12k-mac-wuninitialized-v1-1-3fda7b17357f@kernel.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: 1eWMtrjngK4Z-rmsMQgfwWnFjBCRDPj3 X-Proofpoint-ORIG-GUID: 1eWMtrjngK4Z-rmsMQgfwWnFjBCRDPj3 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-05_14,2024-01-31_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 lowpriorityscore=0 impostorscore=0 phishscore=0 clxscore=1011 spamscore=0 mlxscore=0 priorityscore=1501 bulkscore=0 suspectscore=0 mlxlogscore=727 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2401310000 definitions=main-2402050155 On 2/5/2024 11:49 AM, Nathan Chancellor wrote: > Clang warns (or errors with CONFIG_WERROR=y): > > drivers/net/wireless/ath/ath12k/mac.c:8060:9: error: variable 'ret' is uninitialized when used here [-Werror,-Wuninitialized] > 8060 | return ret; > | ^~~ > drivers/net/wireless/ath/ath12k/mac.c:8022:9: note: initialize the variable 'ret' to silence this warning > 8022 | int ret, i, j; > | ^ > | = 0 > 1 error generated. > > Commit 6db6e70a17f6 ("wifi: ath12k: Introduce the container for mac80211 > hw") added a completely uninitialized use of ret. Prior to that change, > -ENOMEM was returned to the callers of ath12k_mac_allocate() whenever > ath12k_mac_hw_allocate() failed. Assign that value to ret to make sure > it is always initialized when used and clear up the warning. > > Closes: https://github.com/ClangBuiltLinux/linux/issues/1989i > Fixes: 6db6e70a17f6 ("wifi: ath12k: Introduce the container for mac80211 hw") > Signed-off-by: Nathan Chancellor Acked-by: Jeff Johnson