From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1F6D53346B2 for ; Mon, 5 Jan 2026 12:25:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.65 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767615910; cv=none; b=VkBWPAGrkRzeaqDoRw4PgxzoIJNhRh1vNyGig8Da1riiz0ze1bKfXpvfNiH6A4ShIu8GKABx32ramyr+LT++XXvnxH4oy+JHrWLOaxiv+FlIGKyAuYr4wwGEdFBALcud2AU5dg11m9k2Lq04TcdeNKs1UmwuFWfv1ZOsQZ/NYVA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767615910; c=relaxed/simple; bh=F94WSDFVRm+NrIR45Tte4W4BwwT67J+ExCFM2ZpbWjY=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=l2xTOkkX8E1hR6f7f4TwDq7U9TzqT90whFX1Q4nMMlEjjJzUcOh65+0PN1oMvh0rgxvmFYzvVRMoObJqct8vnSN/uZyJFfZidSe45/iXcvwxDaP3Y6lE8Xu2b0JEcN+F+51jzpN+5KnFKiJHg2C0L/rOnpdwfubhCYvOwAPv7uk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Czn1k4FP; arc=none smtp.client-ip=209.85.128.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Czn1k4FP" Received: by mail-wm1-f65.google.com with SMTP id 5b1f17b1804b1-47d5e021a53so29819615e9.3 for ; Mon, 05 Jan 2026 04:25:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1767615906; x=1768220706; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=DT3pnDjpknN9ygYrWIs2s6mtq9dI87CHEejFASEljXs=; b=Czn1k4FP+gB+EP2lKrEp+pDjGrcB2YGdVXbpJqLqcVF/3bW89q56wV+RAV0VpEDm+2 F0BEQ5IZnsOhqhuFx8pkIMBuDPntFF/yWTDiSWDz4ELb5kpLKXpoRRZygRBYzEQOdjCx OUlb6G8n0LKBlnybw4z+MZWRtTZHoHc7aJuffp/U3ct7zqsS1ReKXZ97d70pkEmtZY8v D2iInRYiYXWN8Wdm7PgyrYQMIcSbyAjfN3EOFBlCz/Ldh1lHfyY71RvlTXKmqn3jmPm6 ZoU5VOaTXS5h1VyGQWGgrS5mNui/7tFqwT3vsl1wTj2c2fxhjWLxhxHQCDlqWmMDblPL Jm3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767615906; x=1768220706; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=DT3pnDjpknN9ygYrWIs2s6mtq9dI87CHEejFASEljXs=; b=ZRZRMGQL20QmXxS7ZgVqUesFZnOyUsuD5njueWAXrbqyJwf3z7qryaHrPSh823ZqdC WoA/StmuvMgKzwOzrg8B+r31y8HB/tm3+WmaHiFPtUG7yUHtkS7+O74DlIw8wdHtZYIG vBl+lUgSvZhOlSMaHJ06JJ1HWoWRuV1qfQ/S/Ymce2uO+celC1pkqxeGCnJaWIjJtVFI 5D19mOWjqrri4/vmwFzU1jDGcN6lKbFGE+m7YWs1s1bl2+D4KI0Xd88YWPcFEQ1hCcIr EpRiZ7+StH7RFaZ59bdJh9VsPtRdjba0hqxzFe6omCQ62JyPTjBU2z577a2w51UtZkEk ri9w== X-Forwarded-Encrypted: i=1; AJvYcCWBLew8TU4v/vj93gdRltE6FhP59HSdHpPLb8FtygOJA5tJ4TSCLDU+GFjHN7izdVczubGrV7oOyX5/MJg=@vger.kernel.org X-Gm-Message-State: AOJu0YwGtBW0vP237V1XZF9b8NsIZLuJBmlmihAe0n6ToAsOuoH4C0Qe N56tDmpmCDcS5J1Y7ESRHaAA9SMlGmrjlIaYjSYns5zw4dq1qQPES4UALklvfgp1mVk= X-Gm-Gg: AY/fxX6hiDMfAohlvFudh5Q/ybb5FvcEZSy8DV4z2a+Kk86A9etqTtoI2hU0Gr5uFF7 KguU0uKzNFzWOriRo2pnxFPZUGwYBmwgu8Sin/rBn0MXhg6ek9QV+zcdP6wlrD1IVAR5w+20NKY O4qlaw0FSueAaxPW1++tumrSUVTEfbuJXyLHNrCJYwy+DZBaME/kxxOrqilaNRS7ucn4D0I0cb5 tP0TE8jfs8jarHZf325Qk1OCZ0/eQZesy6i3pO79njZMky6orKbdB+YbcwOgsoe3JpNCODVMXdN tVAkeBWtprLFzXVoRd7ArobzQXPymj9/CvhHF+Pn3jhLMIFciQ8TZCawuOIifQ008QTVL/lhyJq fttSuOfG2elfsHgPgAj2j24AYDc44MGsDXV4DhsjrX8Pc5xtJfWxWm0P52FcyWTtfOIaeBnvOjS isXUu/rik7aQW0RBzV X-Google-Smtp-Source: AGHT+IHmAWAnmy61ZiDLNiFuZuU7bfRZMbr/IK49jKERbJ9mENHjldiHWq0LGVSRZRIDyPPKbTReTA== X-Received: by 2002:a05:600c:46d5:b0:477:632c:5b91 with SMTP id 5b1f17b1804b1-47d1954e3e4mr719204415e9.16.1767615906175; Mon, 05 Jan 2026 04:25:06 -0800 (PST) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47d6ba30531sm60872835e9.1.2026.01.05.04.25.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jan 2026 04:25:04 -0800 (PST) Date: Mon, 5 Jan 2026 15:25:01 +0300 From: Dan Carpenter To: oe-kbuild@lists.linux.dev, Timothy Pearson Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org, Madhavan Srinivasan , Shawn Anastasio , Bjorn Helgaas Subject: drivers/pci/hotplug/pnv_php.c:710 pnv_php_alloc_slot() warn: address of NULL pointer 'php_slot->bus' Message-ID: <202601050123.5JEZ4Znh-lkp@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 54e82e93ca93e49cb4c33988adec5c8cb9d0df31 commit: 4668619092554e1b95c9a5ac2941ca47ba6d548a PCI: pnv_php: Clean up allocated IRQs on unplug config: powerpc64-randconfig-r071-20260104 (https://download.01.org/0day-ci/archive/20260105/202601050123.5JEZ4Znh-lkp@intel.com/config) compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 9b8addffa70cee5b2acc5454712d9cf78ce45710) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Reported-by: Dan Carpenter | Closes: https://lore.kernel.org/r/202601050123.5JEZ4Znh-lkp@intel.com/ smatch warnings: drivers/pci/hotplug/pnv_php.c:710 pnv_php_alloc_slot() warn: address of NULL pointer 'php_slot->bus' vim +710 drivers/pci/hotplug/pnv_php.c 66725152fb9f17b Gavin Shan 2016-05-20 678 static struct pnv_php_slot *pnv_php_alloc_slot(struct device_node *dn) 66725152fb9f17b Gavin Shan 2016-05-20 679 { 66725152fb9f17b Gavin Shan 2016-05-20 680 struct pnv_php_slot *php_slot; 66725152fb9f17b Gavin Shan 2016-05-20 681 struct pci_bus *bus; 66725152fb9f17b Gavin Shan 2016-05-20 682 const char *label; 66725152fb9f17b Gavin Shan 2016-05-20 683 uint64_t id; 39f0d6fbdc3f205 Gavin Shan 2016-09-29 684 int ret; 66725152fb9f17b Gavin Shan 2016-05-20 685 39f0d6fbdc3f205 Gavin Shan 2016-09-29 686 ret = of_property_read_string(dn, "ibm,slot-label", &label); 39f0d6fbdc3f205 Gavin Shan 2016-09-29 687 if (ret) 66725152fb9f17b Gavin Shan 2016-05-20 688 return NULL; 66725152fb9f17b Gavin Shan 2016-05-20 689 66725152fb9f17b Gavin Shan 2016-05-20 690 if (pnv_pci_get_slot_id(dn, &id)) 66725152fb9f17b Gavin Shan 2016-05-20 691 return NULL; 66725152fb9f17b Gavin Shan 2016-05-20 692 66725152fb9f17b Gavin Shan 2016-05-20 693 bus = pci_find_bus_by_node(dn); 149ba66a90a3b3c Gavin Shan 2016-09-28 694 if (!bus) 66725152fb9f17b Gavin Shan 2016-05-20 695 return NULL; 66725152fb9f17b Gavin Shan 2016-05-20 696 66725152fb9f17b Gavin Shan 2016-05-20 697 php_slot = kzalloc(sizeof(*php_slot), GFP_KERNEL); 149ba66a90a3b3c Gavin Shan 2016-09-28 698 if (!php_slot) 66725152fb9f17b Gavin Shan 2016-05-20 699 return NULL; 66725152fb9f17b Gavin Shan 2016-05-20 700 66725152fb9f17b Gavin Shan 2016-05-20 701 php_slot->name = kstrdup(label, GFP_KERNEL); 149ba66a90a3b3c Gavin Shan 2016-09-28 702 if (!php_slot->name) { 66725152fb9f17b Gavin Shan 2016-05-20 703 kfree(php_slot); 66725152fb9f17b Gavin Shan 2016-05-20 704 return NULL; 66725152fb9f17b Gavin Shan 2016-05-20 705 } 66725152fb9f17b Gavin Shan 2016-05-20 706 4668619092554e1 Timothy Pearson 2025-07-15 707 /* Allocate workqueue for this slot's interrupt handling */ 4668619092554e1 Timothy Pearson 2025-07-15 708 php_slot->wq = alloc_workqueue("pciehp-%s", 0, 0, php_slot->name); 4668619092554e1 Timothy Pearson 2025-07-15 709 if (!php_slot->wq) { 4668619092554e1 Timothy Pearson 2025-07-15 @710 SLOT_WARN(php_slot, "Cannot alloc workqueue\n"); The SLOT_WARN() macro looks like: #define SLOT_WARN(sl, x...) \ ((sl)->pdev ? pci_warn((sl)->pdev, x) : dev_warn(&(sl)->bus->dev, x)) Neither ->pdev nor ->bus are set so it will crash. 4668619092554e1 Timothy Pearson 2025-07-15 711 kfree(php_slot->name); 4668619092554e1 Timothy Pearson 2025-07-15 712 kfree(php_slot); 4668619092554e1 Timothy Pearson 2025-07-15 713 return NULL; 4668619092554e1 Timothy Pearson 2025-07-15 714 } 4668619092554e1 Timothy Pearson 2025-07-15 715 149ba66a90a3b3c Gavin Shan 2016-09-28 716 if (dn->child && PCI_DN(dn->child)) 66725152fb9f17b Gavin Shan 2016-05-20 717 php_slot->slot_no = PCI_SLOT(PCI_DN(dn->child)->devfn); 66725152fb9f17b Gavin Shan 2016-05-20 718 else 66725152fb9f17b Gavin Shan 2016-05-20 719 php_slot->slot_no = -1; /* Placeholder slot */ 66725152fb9f17b Gavin Shan 2016-05-20 720 66725152fb9f17b Gavin Shan 2016-05-20 721 kref_init(&php_slot->kref); 66725152fb9f17b Gavin Shan 2016-05-20 722 php_slot->state = PNV_PHP_STATE_INITIALIZED; 66725152fb9f17b Gavin Shan 2016-05-20 723 php_slot->dn = dn; 66725152fb9f17b Gavin Shan 2016-05-20 724 php_slot->pdev = bus->self; 66725152fb9f17b Gavin Shan 2016-05-20 725 php_slot->bus = bus; 66725152fb9f17b Gavin Shan 2016-05-20 726 php_slot->id = id; 66725152fb9f17b Gavin Shan 2016-05-20 727 php_slot->power_state_check = false; 66725152fb9f17b Gavin Shan 2016-05-20 728 php_slot->slot.ops = &php_slot_ops; 66725152fb9f17b Gavin Shan 2016-05-20 729 66725152fb9f17b Gavin Shan 2016-05-20 730 INIT_LIST_HEAD(&php_slot->children); 66725152fb9f17b Gavin Shan 2016-05-20 731 INIT_LIST_HEAD(&php_slot->link); 66725152fb9f17b Gavin Shan 2016-05-20 732 66725152fb9f17b Gavin Shan 2016-05-20 733 return php_slot; 66725152fb9f17b Gavin Shan 2016-05-20 734 } -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki