From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 C3052423A63 for ; Wed, 6 May 2026 11:57:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778068633; cv=none; b=nawKPENfhNw9b3wEQY0gaDmCPyAzXVvytL4MR6BgmwClwqvMNh7ACdvToDrvxk/5PNRMuYlyJEerwBAOw5CMYBO2AdofmxTQdzJvQ+jdMFrBVbj+wvIWKeim+9dsSaHTJWIodJFdtMZyLBkZP868tquQmRXXnHMfrj1ETH+NUB0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778068633; c=relaxed/simple; bh=87NP7XwywOn9x/iXWB+eXS5eWuDkx8j+CF4L7FZPusM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=NcMyAMuFqp2B/H1Gigzfcy4pRyfaUNJk8MOFmHaayiHxc8OQFOpvJ+2KjC1+rMEJadI5Y7krpmnHGSqKPUxuUcv+Ygdy+9hdvmurPYVi0BlrpmAxqgh7NpmWyM51YqJSNfLGtNG5p+YIvFEXoXiMoSpvQFDRvK01BJyiL0AuKSk= 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=es7gRqPv; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=LAaJQpp5; arc=none smtp.client-ip=205.220.168.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="es7gRqPv"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="LAaJQpp5" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 646A3Zcm1953203 for ; Wed, 6 May 2026 11:57:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:message-id:mime-version :subject:to; s=qcppdkim1; bh=Odr8obAqI6YzuQA1Xf0eZUfZcXB+THZa+6j Hl6jpP9g=; b=es7gRqPvfcWjkrWR2L584axIUuruZrtV6MWjOIfz7Lh1qSod49p Oy8XigTxcm9eNpkWcayHLBAGl0VvVqQhYUX+SAh5f6n1w6RBEaEAo83Xz/Hv7Du9 6VYjwznv6cbl85IlV5FtzNpAORbLU2D5fShggV9A7NJSBQG78P/4evOrheeLY16/ zXNVzW1+4+M90DyGoFSd5J6MZJFsKQq+Arruncd7eXWyloeYem9HlCXF9iXelcZs w/eEXlA7LzMN1Gh02d605dI+kI1YO4/cQ2Fhpn7o6dRaV2qyU4zWmPdQI/XppJX7 zekoMJJwlhQya9WcC2w3j4dbsIiuETzuaOg== Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4e03jc0b27-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 06 May 2026 11:57:12 +0000 (GMT) Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-51009190feeso147016561cf.2 for ; Wed, 06 May 2026 04:57:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1778068631; x=1778673431; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Odr8obAqI6YzuQA1Xf0eZUfZcXB+THZa+6jHl6jpP9g=; b=LAaJQpp5SExFXdKFbSqZlBYkrRZ00hUU2Ua5ZpcHT3TWlKkeeqTd8MANgnsm/WU2/f jeSgCWn4jN4C+Zfjlxhfpc7cxRh78OZjHlZKB5bDq11YQy1q3ill4AUpDvnrkx1S237s 4NLrlZmR2qDdUl/Z3vCxdF0u6JxnN6j7tsqjelf+jOlw+/6p2SsVeU4NCy2O9uAKKnci J5OPmezin6uT/L7xyDKlF0090aTWOTWVgXKo4fg1i9VYZ4pMttiPTHz+qPIDnyABIUH2 PPmsyljpn+KURkpbm/MIjwzpT/BVHQBNr9xc2YBLdDz1o7H54b3eP9aSEBk+W4pYRQtN I+aQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778068631; x=1778673431; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Odr8obAqI6YzuQA1Xf0eZUfZcXB+THZa+6jHl6jpP9g=; b=HC9levHYXCiooiUXyw9BAzzsmnRbx63MT3/RfvJ43/b78+xsjK0IYJicN2oCKZ9IGP AO4Z5X6pFM2d7Ofwc2mAHNGeZIRu3128URniqW6KP8RP1er6sHCBbyStZPptVSBb2lN+ 6C4Pu3CZ8L8ix2ZiXeT/X6IxxU5at838a4B64oRBIm69uKYFBd7Btqq7yzeqbIkIZzk/ R7YdAfjysEmdaSMCCVqRUJOQrzjdprPnEX0Mnz9EB6wC9VmKEjEmJs6gwCtXeKe/gqY8 LvRPR7Af/wZ/41PO1fJ1A3Pbp62WmmgLWY+mIDjYdCG+tkl0+udfzBGKAo7n6GU7bjWn fLCg== X-Forwarded-Encrypted: i=1; AFNElJ82Pkqk7qm296XYxRG/HyT9UcL7OZkQGxoVEjCAcXYpPXG5BgOtM0nZx+LHafWxyh1xk6YeDWj5pQwbJ0c=@vger.kernel.org X-Gm-Message-State: AOJu0YyUT6vIH5ScBUb8WDT2bjorr9VPpvzB5ThzXZarCjLjvVE8cN6G zObwMZKc3WZp622txlzSwCw3TVHJUo1w7nrftdGNktrPVJIS60Os50ER7jjl5nSQu6Z3gQ+SnN6 lnQ9+f/WmQ1VS2b1r9sayANALfK54qsWrlkNqoVXGQfjmNx09jKjz29okGNCSH3PjIqw= X-Gm-Gg: AeBDietguDfWjPMukXPQotJ4UVC305AMHrlJxyRVR/npLxaoIsrpfHhP3M1IPVfCokJ h8yBUfxnoYLjOpeKbFua9tbxsAQf6jFCxet5X6nI3UdA1FGhdzyZq8Fw8WdZHJoNjgy+NDqXgWp hJewduX5aAvTJ+adtr/3hXguO+ou0+0SD1TCBrpiiC3EU49bYp4Js6To6tty33uOmYx0BbGdxDQ qHNYbq+D9MTz5MwlRw2w/Dwj4XdHEw66QkpsARyABlHXsWQVw1g4A9CiYoh9Kfv93KJj42gEmnW LogZcWEJC0KrRohag1gWeLjXo5K5lfg8pU4VfXs4OPX/rkIjKXju+T37k0M/gcZSVXW3PuIgOhA KBDF6hOVZI4CLK8nunvePXiBvGx5Melf3HREYkH4q3dT0ofCgZzPgUmpl1RmY X-Received: by 2002:a05:622a:608c:b0:50e:60b7:bb40 with SMTP id d75a77b69052e-51461157e8emr44080311cf.0.1778068631070; Wed, 06 May 2026 04:57:11 -0700 (PDT) X-Received: by 2002:a05:622a:608c:b0:50e:60b7:bb40 with SMTP id d75a77b69052e-51461157e8emr44079861cf.0.1778068630631; Wed, 06 May 2026 04:57:10 -0700 (PDT) Received: from brgl-qcom.home ([2a01:cb1d:dc:7e00:ebfc:d4d5:c415:532a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4504f4857ffsm11651522f8f.0.2026.05.06.04.57.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 04:57:09 -0700 (PDT) From: Bartosz Golaszewski To: Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Len Brown , Rob Herring , Saravana Kannan Cc: driver-core@lists.linux.dev, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, brgl@kernel.org, Bartosz Golaszewski , stable@vger.kernel.org Subject: [PATCH] device property: set fwnode->secondary to NULL in fwnode_init() Date: Wed, 6 May 2026 13:57:00 +0200 Message-ID: <20260506115701.23035-1-bartosz.golaszewski@oss.qualcomm.com> X-Mailer: git-send-email 2.47.3 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-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTA2MDExNSBTYWx0ZWRfX8yEcX2P2zLW3 iyJQfjc/Yl9tZ+9tNPp13vjuMaCkPeMemcO0a5kCYNWYSjRMgT29bowmkWuCzBlK3ydwouPGszl 3iQK1UmHPOVprduOmpDXAgxTDuEYNhRPeKUMWAe2YHyNt12DjNbzYAj8iWAA2/JDAFdKbrR0GoF EiDV6idSlncLv1TKSsDSAM6TqbUktz5pVr58FhHshYd/b+UgI9+G+tPh0KtARL5SBDCnUI+tM06 SaF5UcmIfZiScFvxcsv7lKzhRQ2JQopwVmv2HLWV9aiIkGzwallk+V8JgBfWqnsPZ1rH0k7rJby 3e7TzwFE4+plFJp+XMwaEN7M30PL5peguROVd1y/9AD/zTGJHdVwM5rPCvTmnXSkfp2/XuvPDfX cNWoVXip0Smn4vOFWLEVLKMM281UPdcLmxoepO0YKL9ZgqrgclOB22Oq2YYCgC/jL4RaTPoFefD PbpNwbMisxYrARoLDJQ== X-Proofpoint-ORIG-GUID: mq_2JAgC5NVbRpAA1SX1Z4iIGfbIA4gS X-Proofpoint-GUID: mq_2JAgC5NVbRpAA1SX1Z4iIGfbIA4gS X-Authority-Analysis: v=2.4 cv=EpHiaycA c=1 sm=1 tr=0 ts=69fb2c98 cx=c_pps a=JbAStetqSzwMeJznSMzCyw==:117 a=xqWC_Br6kY4A:10 a=NGcC8JguVDcA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=oySY2n27BtFPXPS6EewA:9 a=uxP6HrT_eTzRwkO_Te1X:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-05-05_03,2026-04-30_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 bulkscore=0 priorityscore=1501 malwarescore=0 adultscore=0 impostorscore=0 phishscore=0 lowpriorityscore=0 clxscore=1015 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2605060115 If a firmware node is allocated on the stack (for instance: temporary software node whose life-time we control) or on the heap - but using a non-zeroing allocation function - and initialized using fwnode_init(), its secondary pointer will contain uninitalized memory which likely will be neither NULL nor IS_ERR() and so may end up being dereferenced (for example: in dev_to_swnode()). Set fwnode->secondary to NULL on initialization. Cc: stable@vger.kernel.org Fixes: 01bb86b380a3 ("driver core: Add fwnode_init()") Signed-off-by: Bartosz Golaszewski --- include/linux/fwnode.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/fwnode.h b/include/linux/fwnode.h index 80b38fbf2121..31df7608737e 100644 --- a/include/linux/fwnode.h +++ b/include/linux/fwnode.h @@ -208,6 +208,7 @@ struct fwnode_operations { static inline void fwnode_init(struct fwnode_handle *fwnode, const struct fwnode_operations *ops) { + fwnode->secondary = NULL; fwnode->ops = ops; INIT_LIST_HEAD(&fwnode->consumers); INIT_LIST_HEAD(&fwnode->suppliers); -- 2.47.3