From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (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 D619818FDBE for ; Tue, 30 Dec 2025 16:47:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767113233; cv=none; b=NTo05cW+MyGnJeV4avkNwQhyK6xl1JuYYZLf4P5O8b1BuRAEGPtn5QMLFyEGqjlk6tBEPQxjgl8/z1/bcylnDhaiIt5dSKXRZvPdz9UqOdosykfB0kM574KqZR56FIfP5JmTvfgrH1obK6UwzahtuNE5zVPgwpmyOKgxDd3Q5mA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767113233; c=relaxed/simple; bh=azMGZ+Y/w738X1gTmr+Ft9ox9muQzUuW+4LiLYeeONg=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=qN5Uzh7G1LundgT466lgdWzJgdw0egHhP/AtIQar5t5DQtQvXFM9iC17X4gEJfpGEAL5wBsT6WgRoBNdq+VEhhrVdAeyy31kmiuoV3QUIb8NNdxD8OHsfXE+od++g3FpGjPg2us1MDfJ7escWgoY7Wv0/6VXQBJJHDdUgx0k3BM= 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=J258kGX7; arc=none smtp.client-ip=209.85.221.41 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="J258kGX7" Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-4327778df7fso2025734f8f.3 for ; Tue, 30 Dec 2025 08:47:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1767113229; x=1767718029; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=3pfquFHr2E1uP9KAC57iEkcByjX7EFnU9BkMGY8sqcI=; b=J258kGX7uHWdgvpGqbYW7ud/5IBSNeAZqxwB9k1PdRmHQZsOUW3VoAYAh0cVZn95Nn aYXQQNmZ1XiAikkM9a1YLUFcFIgO11QmHqRmTMScDOdGMh51pgiBi/5PEbWLa6RY7B92 DxUf/6/D3TDqo8h43HP0Rf7KXVn7hOJMsh/oDDWc2/MbobvJJXS36MEHcoS1/Erow739 DOiOHE7aC+Gi+c9yTOnT1puB/DL1DHO2727C5ok0CwmlvI8nasDQn1ZKd4FUZRiJOPUW oBP59Hz2525bGQBWgw9TeDoxU0g9yk6333TA/eFlMllKxUu21T6y0IzBB4AODh9+1pDM JjDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767113229; x=1767718029; h=in-reply-to: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=3pfquFHr2E1uP9KAC57iEkcByjX7EFnU9BkMGY8sqcI=; b=iFZZRCjQ1UcKb9t0zMP8awijLoZE8PyRqCfRvAm6v5pXl1bzKGg4HhXg33CvQO83fP 9dGdqHYSmFPPvO8jYX7dKpWqTeYm5G5jAS1HR+Yn6A2YsnocaUxE4kXU/6Vt0Tberf6W jknCh7TbYZbklqhCY+A5bEGaWi/6YMIpInY/+JObj5SLdYhu8vuT7SRimydWohrh6CuJ ljTMxK63uLbwq8nTm2E1YTf4o3BD1AoIL77HgNHcuITFeusZn9XfbhKHy6S8vZqyvDoh v6eOEN8i4DfR65hBbXCSD+RDPep+C6ufkrmr29npW3LGBSnHhzZlnnM9fv+X5glQMw3j wJcQ== X-Forwarded-Encrypted: i=1; AJvYcCUAuYY8G3D6QfrMrXWOSpIrPwt+1brKmmTnb469NB8QRiSEGoJufxMzFbAJqnMKrxzabSdTdScWSmz0Hp4=@vger.kernel.org X-Gm-Message-State: AOJu0YzTd3wpVmZy5AGaEnTHexMF4kdTGAmSXE1k6qo0MOHCuH1j5UZX jF1yw1SlzZIB5BxXqwYwkNg7NZmBbWmlsz6GRrgbpBn2aD1P1b8kzpFGvJaSuS6Ze3k= X-Gm-Gg: AY/fxX58YX4398t5Pjxfeml0TeZvPC2dWXzZdxzTwEN+WsCJKjUzIwrkZLiChHml858 iyKodVPIxW5x1//D8LVjEi1rxsRv2do7FZmtyEaDXdDZ9DCkp0nsCZ55if59lx5n1K9nxEDznmz v8WTK2nYUbEYQxH6xapJYlkjhgvZoQrJH7XDhi1IvbrN/AeQOi74F+ZiJoP7nyw9KxWVGLjZnZe nX7BBcWGMVIFEXlCm+M1RR85TllmEIr9X0ydgo24kkdkEn5tpbKwPdmGwSl21c/DJtwTiseKH0K 5ThntOWMQmj6SyO16xM3mie41qkiJChM0yLzWoGhgoxRKDEECAflF/9Ko44Xak9ZsVjOVAaepNJ iV+3wPWTLkMZbQl8xv+XR/7gJ8zDEchwr95Sr9vElEjlXhq4eApaRakS1d9GlHCTJpQ6az3dBLa HCDIW2a+Pw2OlWucd/ X-Google-Smtp-Source: AGHT+IHMq3rkyfVIFLOAgqrtI8Kd81444k2H0h1pzFPyc4MxuoT1oRDzP4THcxMscABTwCEuwuAx4Q== X-Received: by 2002:a05:6000:144c:b0:430:ff81:2965 with SMTP id ffacd0b85a97d-4324e50bb11mr43495198f8f.49.1767113228812; Tue, 30 Dec 2025 08:47:08 -0800 (PST) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43277b82a58sm35493375f8f.6.2025.12.30.08.47.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Dec 2025 08:47:08 -0800 (PST) Date: Tue, 30 Dec 2025 19:47:05 +0300 From: Dan Carpenter To: oe-kbuild@lists.linux.dev, Shivendra Pratap , Sebastian Reichel , Bartosz Golaszewski , Bjorn Andersson Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, Shivendra Pratap Subject: Re: [PATCH v22 2/2] power: reset: reboot-mode: Expose sysfs for registered reboot_modes Message-ID: <202512271806.n2lycyZw-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 In-Reply-To: <20251227-next-15nov_expose_sysfs-v22-2-2d153438ba19@oss.qualcomm.com> Hi Shivendra, kernel test robot noticed the following build warnings: url: https://github.com/intel-lab-lkp/linux/commits/Shivendra-Pratap/Documentation-ABI-Add-sysfs-class-reboot-mode-reboot_modes/20251227-025914 base: cc3aa43b44bdb43dfbac0fcb51c56594a11338a8 patch link: https://lore.kernel.org/r/20251227-next-15nov_expose_sysfs-v22-2-2d153438ba19%40oss.qualcomm.com patch subject: [PATCH v22 2/2] power: reset: reboot-mode: Expose sysfs for registered reboot_modes config: x86_64-randconfig-161-20251227 (https://download.01.org/0day-ci/archive/20251227/202512271806.n2lycyZw-lkp@intel.com/config) compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261) rustc: rustc 1.88.0 (6b00bc388 2025-06-23) 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/202512271806.n2lycyZw-lkp@intel.com/ smatch warnings: drivers/power/reset/reboot-mode.c:147 reboot_mode_create_device() error: we previously assumed 'head' could be null (see line 112) vim +/head +147 drivers/power/reset/reboot-mode.c e5f49083a20ae0 Shivendra Pratap 2025-12-27 103 static int reboot_mode_create_device(struct reboot_mode_driver *reboot) e5f49083a20ae0 Shivendra Pratap 2025-12-27 104 { e5f49083a20ae0 Shivendra Pratap 2025-12-27 105 struct sysfs_data *sysfs_info; e5f49083a20ae0 Shivendra Pratap 2025-12-27 106 struct sysfs_data *next; e5f49083a20ae0 Shivendra Pratap 2025-12-27 107 struct list_head *head; e5f49083a20ae0 Shivendra Pratap 2025-12-27 108 struct mode_info *info; e5f49083a20ae0 Shivendra Pratap 2025-12-27 109 int ret; e5f49083a20ae0 Shivendra Pratap 2025-12-27 110 e5f49083a20ae0 Shivendra Pratap 2025-12-27 111 head = kzalloc(sizeof(*head), GFP_KERNEL); e5f49083a20ae0 Shivendra Pratap 2025-12-27 @112 if (!head) { e5f49083a20ae0 Shivendra Pratap 2025-12-27 113 ret = -ENOMEM; e5f49083a20ae0 Shivendra Pratap 2025-12-27 114 goto error; This should just be return -ENOMEM; e5f49083a20ae0 Shivendra Pratap 2025-12-27 115 } e5f49083a20ae0 Shivendra Pratap 2025-12-27 116 e5f49083a20ae0 Shivendra Pratap 2025-12-27 117 INIT_LIST_HEAD(head); e5f49083a20ae0 Shivendra Pratap 2025-12-27 118 e5f49083a20ae0 Shivendra Pratap 2025-12-27 119 list_for_each_entry(info, &reboot->head, list) { e5f49083a20ae0 Shivendra Pratap 2025-12-27 120 sysfs_info = kzalloc(sizeof(*sysfs_info), GFP_KERNEL); e5f49083a20ae0 Shivendra Pratap 2025-12-27 121 if (!sysfs_info) { e5f49083a20ae0 Shivendra Pratap 2025-12-27 122 ret = -ENOMEM; e5f49083a20ae0 Shivendra Pratap 2025-12-27 123 goto error; e5f49083a20ae0 Shivendra Pratap 2025-12-27 124 } e5f49083a20ae0 Shivendra Pratap 2025-12-27 125 e5f49083a20ae0 Shivendra Pratap 2025-12-27 126 sysfs_info->mode = kstrdup_const(info->mode, GFP_KERNEL); e5f49083a20ae0 Shivendra Pratap 2025-12-27 127 if (!sysfs_info->mode) { e5f49083a20ae0 Shivendra Pratap 2025-12-27 128 kfree(sysfs_info); e5f49083a20ae0 Shivendra Pratap 2025-12-27 129 ret = -ENOMEM; e5f49083a20ae0 Shivendra Pratap 2025-12-27 130 goto error; e5f49083a20ae0 Shivendra Pratap 2025-12-27 131 } e5f49083a20ae0 Shivendra Pratap 2025-12-27 132 e5f49083a20ae0 Shivendra Pratap 2025-12-27 133 list_add_tail(&sysfs_info->list, head); e5f49083a20ae0 Shivendra Pratap 2025-12-27 134 } e5f49083a20ae0 Shivendra Pratap 2025-12-27 135 e5f49083a20ae0 Shivendra Pratap 2025-12-27 136 reboot->reboot_mode_device = device_create(&reboot_mode_class, NULL, 0, e5f49083a20ae0 Shivendra Pratap 2025-12-27 137 (void *)head, reboot->dev->driver->name); e5f49083a20ae0 Shivendra Pratap 2025-12-27 138 e5f49083a20ae0 Shivendra Pratap 2025-12-27 139 if (IS_ERR(reboot->reboot_mode_device)) { e5f49083a20ae0 Shivendra Pratap 2025-12-27 140 ret = PTR_ERR(reboot->reboot_mode_device); e5f49083a20ae0 Shivendra Pratap 2025-12-27 141 goto error; e5f49083a20ae0 Shivendra Pratap 2025-12-27 142 } e5f49083a20ae0 Shivendra Pratap 2025-12-27 143 e5f49083a20ae0 Shivendra Pratap 2025-12-27 144 return 0; e5f49083a20ae0 Shivendra Pratap 2025-12-27 145 e5f49083a20ae0 Shivendra Pratap 2025-12-27 146 error: e5f49083a20ae0 Shivendra Pratap 2025-12-27 @147 list_for_each_entry_safe(sysfs_info, next, head, list) { ^^^^ But it is a crash instead. e5f49083a20ae0 Shivendra Pratap 2025-12-27 148 list_del(&sysfs_info->list); e5f49083a20ae0 Shivendra Pratap 2025-12-27 149 kfree_const(sysfs_info->mode); e5f49083a20ae0 Shivendra Pratap 2025-12-27 150 kfree(sysfs_info); e5f49083a20ae0 Shivendra Pratap 2025-12-27 151 } e5f49083a20ae0 Shivendra Pratap 2025-12-27 152 e5f49083a20ae0 Shivendra Pratap 2025-12-27 153 kfree(head); e5f49083a20ae0 Shivendra Pratap 2025-12-27 154 reboot->reboot_mode_device = NULL; e5f49083a20ae0 Shivendra Pratap 2025-12-27 155 return ret; e5f49083a20ae0 Shivendra Pratap 2025-12-27 156 } -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki