From nobody Sun Feb 8 16:53:20 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=cloud.com ARC-Seal: i=1; a=rsa-sha256; t=1704810034; cv=none; d=zohomail.com; s=zohoarc; b=Td4JeyrFfbOaf2SrwUYcrCzWJ74mSVwShmNlWfkQ5ks8QjVmLVdtfyinQAQ58ivNJwWS51YUDyT8SuTR9mg+SK6V3ch3xuHodUnG/c2+UsSG8w0udmsF/I22/D3baYJdWV/VMKvaXXg0capGBUtjPxKca1+qxznHyDnM2YmePnY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704810034; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=VfD5eh+5AnOG7qBGieEa/3TaBhZ4atnwdaWBB6XiDjE=; b=Na3PTM42AnJ9XVLG0bDDxAONk1HbpR/uRKpa56cyFxliJa0FpJNeY0QZobzTQgXVxEPo6kb4r9u9jdgJ8rbHqXndcMBJ7bNadvX1z0p0BcT1VJTpiVmaHjD4ZrUgFdANwyVxWf8GCB7rrEKL7H5GfbtYUpPj4HrEeMKGf8Tsfgs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1704810034304811.5383798111402; Tue, 9 Jan 2024 06:20:34 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.664637.1034711 (Exim 4.92) (envelope-from ) id 1rNCxf-0003AU-IT; Tue, 09 Jan 2024 14:20:11 +0000 Received: by outflank-mailman (output) from mailman id 664637.1034711; Tue, 09 Jan 2024 14:20:11 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rNCxf-0003AN-Fn; Tue, 09 Jan 2024 14:20:11 +0000 Received: by outflank-mailman (input) for mailman id 664637; Tue, 09 Jan 2024 14:20:10 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rNCxe-000388-2B for xen-devel@lists.xenproject.org; Tue, 09 Jan 2024 14:20:10 +0000 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [2a00:1450:4864:20::52b]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 2fe660bc-aefa-11ee-9b0f-b553b5be7939; Tue, 09 Jan 2024 15:20:06 +0100 (CET) Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-5534dcfdd61so5348367a12.0 for ; Tue, 09 Jan 2024 06:20:06 -0800 (PST) Received: from jmerino-thinkstation.citrite.net (default-46-102-197-194.interdsl.co.uk. [46.102.197.194]) by smtp.gmail.com with ESMTPSA id h15-20020aa7c94f000000b00557c6778b88sm1006014edt.53.2024.01.09.06.20.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 06:20:05 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 2fe660bc-aefa-11ee-9b0f-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloud.com; s=cloud; t=1704810006; x=1705414806; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=VfD5eh+5AnOG7qBGieEa/3TaBhZ4atnwdaWBB6XiDjE=; b=kXAOMfVGsjpA4vZ6X0gVhdWHjeBaLsEho3mbkE8Jb1HjBRJMerZQ16ELfiDUzs1qTn x8YKDCYH/Fy0meMvNITzulx/qqq9ItWckUH8FgPKi6K3rAentLrCp/YaBdvvLgES7fU3 b+/TD5DSHHe1oQ2MHKoEfzuNC4GMsvTniYImM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704810006; x=1705414806; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=VfD5eh+5AnOG7qBGieEa/3TaBhZ4atnwdaWBB6XiDjE=; b=LkBqILaz3pwrUyDDeEZaRUQNvjffVN+sCtVyPM41kUTilI5xXG9Sz/jGB/AWxxMk8t n6NnTn2Kw1USJPlm2DNHMoFV8V2/oLIFVr23OgwwEmSwwLOxe3w0xrqgvGyuNJMZPGaB kPDLIkvOdtGNWvQasKitnsoaNiv+q+VUuhHTI28y+/xRvQ4HI8CZg8kZ7v83hAZYGEgR 8OZll4UYCq6dnfOxbRWhAZRJu16HXxSghW6UwP1Aqwpm5uQsi6IIkrtrK7eGnl3Uc7on QkPqA+iUITsY/hrdA4nV2UcULskHAZLEedNMEZPOREIbt1smY8Xxi9vTFQtzm4ax/JFl J3Gg== X-Gm-Message-State: AOJu0YwR4/WaRWzNWDXoXRc1+kTM1gEyDWNAwRR2M+Ra9iBBw9bRqn+r 3cBoJeN0w/XrJtEPIVbmsBEAl9C5w5dAhB1/vPR7PXJ38GA= X-Google-Smtp-Source: AGHT+IG7hntlSUPKyTnj1CvmJqPeZhGQUUPef1PTC7EqrWuRRTaYvmwYukGK0JZbj3ZAGeDh2JhSKQ== X-Received: by 2002:a50:f695:0:b0:555:9bd7:a4f0 with SMTP id d21-20020a50f695000000b005559bd7a4f0mr949341edn.36.1704810005813; Tue, 09 Jan 2024 06:20:05 -0800 (PST) From: Javi Merino To: xen-devel@lists.xenproject.org Cc: Javi Merino , Vikram Garhwal , Stefano Stabellini , Julien Grall Subject: [PATCH for-4.18 v1] xen/common: Don't dereference overlay_node after checking that it is NULL Date: Tue, 9 Jan 2024 14:19:49 +0000 Message-ID: <6b2db92de764b6031647926d27cb14dd455eff7d.1704809355.git.javi.merino@cloud.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @cloud.com) X-ZM-MESSAGEID: 1704810036139100001 Content-Type: text/plain; charset="utf-8" In remove_nodes(), overlay_node is dereferenced when printing the error message even though it is known to be NULLL. Fix the error message to avoid dereferencing a NULL pointer. The semantic patch that spots this code is available in https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scr= ipts/coccinelle/null/deref_null.cocci?id=3D1f874787ed9a2d78ed59cb21d0d90ac0= 178eceb0 Fixes: 7e5c4a8b86f1 ("xen/arm: Implement device tree node removal functiona= lities") Signed-off-by: Javi Merino --- CC: Vikram Garhwal Vikram, I didn't know what to put in the error message. Feel free to suggest something more appropriate than "Device not present in the tree". --- xen/common/dt-overlay.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xen/common/dt-overlay.c b/xen/common/dt-overlay.c index 5663a049e90a..f04b0c276eea 100644 --- a/xen/common/dt-overlay.c +++ b/xen/common/dt-overlay.c @@ -428,8 +428,7 @@ static int remove_nodes(const struct overlay_track *tra= cker) overlay_node =3D (struct dt_device_node *)tracker->nodes_address[j= ]; if ( overlay_node =3D=3D NULL ) { - printk(XENLOG_ERR "Device %s is not present in the tree. Remov= ing nodes failed\n", - overlay_node->full_name); + printk(XENLOG_ERR "Device not present in the tree. Removing no= des failed\n"); return -EINVAL; } =20 --=20 2.42.0