From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (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 281C92D594F for ; Tue, 7 Apr 2026 04:25:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.10 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775535946; cv=none; b=CnG1VuK1AnCl79gSnBzboeaA3WtO7aba54YyskR8sQeQfocrwVg4/5fpbxJcs3K5r3dOssDOqPUDB4xtXt8/SQ8dHbquovJ4pacCglFgw3qGZ7gWSmdnaKIy0vhUMZm6easwtabXuW/HtYfVPhXOxlJ0Jd1R6nAnGd9i67724NQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775535946; c=relaxed/simple; bh=2QNJ6i4kuIoB0GipZAcAKDVtYgxqLzdsSh1id91fJjg=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type; b=OxLFQUScSTENWH5s5voUT/8ZokKyL1kEgKz2pvx/RYKwNjJKz8yksEeKUHloRff/0OH2jc36pk3gcpJbHgu1SAODW52SRXlMpZH4rsrS3LhWhH/v50oar7MtmYtyb5QX+3R70b5PToUUKQIJf8/AnyNAMKPZO6dVymm4J9Nyhk8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=ZzmvE4mE; arc=none smtp.client-ip=192.198.163.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ZzmvE4mE" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1775535944; x=1807071944; h=date:from:to:cc:subject:message-id:mime-version: content-transfer-encoding; bh=2QNJ6i4kuIoB0GipZAcAKDVtYgxqLzdsSh1id91fJjg=; b=ZzmvE4mE4p/HdfKQyNGgD5+kEGZOJ6Lj97R71pMDtHHYkGU9zm0iSUpk Y12hMKU6+UfjzJAxdhfGH+ZzfAXE58F9CKh7jeMR0KK+cjTO2N07zE8IL 4FtdG5g7ZoOcXDXtF/7kVP/1eyRD7VLdb/jnu4VeWtV3JYN2gpNQu8aS2 6veyrvh43GPBdJclzjoLcfeFdPGfIMnU07Wusm0wtby26L5/aq1tgkzjF T5DY7tEEPyeQbN9IVY2f0pDhj54n8sa+KZIXILpk1ZyoiEoDAqEe68zur WdiO1s9hq4Tw+NbZTNt2BAvGwKVfYwcoPN2AV3pIMjL5cNDpTwBBFxEP1 g==; X-CSE-ConnectionGUID: uKCQ9D2cRBi39BrLBuBJlA== X-CSE-MsgGUID: mSR7MHJcTUuOxwdSmDQs7Q== X-IronPort-AV: E=McAfee;i="6800,10657,11751"; a="87877481" X-IronPort-AV: E=Sophos;i="6.23,164,1770624000"; d="scan'208";a="87877481" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Apr 2026 21:25:44 -0700 X-CSE-ConnectionGUID: dBv7ehvGSDCs6XAfObM45g== X-CSE-MsgGUID: PQD7hIC+TMCohYofNDR0ng== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,164,1770624000"; d="scan'208";a="251196718" Received: from lkp-server01.sh.intel.com (HELO d00eb8a6782a) ([10.239.97.150]) by fmviesa002.fm.intel.com with ESMTP; 06 Apr 2026 21:25:42 -0700 Received: from kbuild by d00eb8a6782a with local (Exim 4.98.2) (envelope-from ) id 1w9y0S-000000000Ar-09ox; Tue, 07 Apr 2026 04:25:40 +0000 Date: Tue, 07 Apr 2026 12:25:13 +0800 From: kernel test robot To: oe-kbuild@lists.linux.dev Cc: lkp@intel.com, Dan Carpenter Subject: [agd5f:drm-next-7.1 55/56] drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c:423 amdgpu_coredump() error: we previously assumed 'job' could be null (see line 414) Message-ID: <202604071441.vAPwv1su-lkp@intel.com> User-Agent: s-nail v14.9.25 Precedence: bulk X-Mailing-List: oe-kbuild@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable BCC: lkp@intel.com CC: oe-kbuild-all@lists.linux.dev TO: "Pierre-Eric Pelloux-Prayer" CC: Alex Deucher tree: https://gitlab.freedesktop.org/agd5f/linux.git drm-next-7.1 head: 7b15fc2d1f1a00fb99f0146e404ff2600999ec74 commit: 32ab301b89b30d71a2e68d86f564eca66f7c52c5 [55/56] drm/amdgpu: store = ib info for devcoredump :::::: branch date: 3 days ago :::::: commit date: 3 days ago config: x86_64-randconfig-161-20260405 (https://download.01.org/0day-ci/arc= hive/20260407/202604071441.vAPwv1su-lkp@intel.com/config) compiler: gcc-14 (Debian 14.2.0-19) 14.2.0 smatch: v0.5.0-9004-gb810ac53 If you fix the issue in a separate patch/commit (i.e. not just a new versio= n of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Reported-by: Dan Carpenter | Closes: https://lore.kernel.org/r/202604071441.vAPwv1su-lkp@intel.com/ smatch warnings: drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c:423 amdgpu_coredump() erro= r: we previously assumed 'job' could be null (see line 414) drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c:425 amdgpu_coredump() warn= : variable dereferenced before check 'job' (see line 423) vim +/job +423 drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c 9022f01b9709331 Sunil Khatri 2024-03-21 398 =20 6122f5c72e38a88 Trigger Huang 2024-08-19 399 void amdgpu_cor= edump(struct amdgpu_device *adev, bool skip_vram_check, 6122f5c72e38a88 Trigger Huang 2024-08-19 400 bool vra= m_lost, struct amdgpu_job *job) 9022f01b9709331 Sunil Khatri 2024-03-21 401 { 9022f01b9709331 Sunil Khatri 2024-03-21 402 struct drm_dev= ice *dev =3D adev_to_drm(adev); 6122f5c72e38a88 Trigger Huang 2024-08-19 403 struct amdgpu_= coredump_info *coredump; 32ab301b89b30d7 Pierre-Eric Pelloux-Prayer 2026-02-04 404 size_t size = =3D sizeof(*coredump); 9022f01b9709331 Sunil Khatri 2024-03-21 405 struct drm_sch= ed_job *s_job; eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 406 u64 total_ring= _size, ring_count; eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 407 struct amdgpu_= ring *ring; eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 408 int i, off, id= x; 9022f01b9709331 Sunil Khatri 2024-03-21 409 =20 4bbba79a7f1d0c7 Pierre-Eric Pelloux-Prayer 2025-02-21 410 /* No need to = generate a new coredump if there's one in progress already. */ 4bbba79a7f1d0c7 Pierre-Eric Pelloux-Prayer 2025-02-21 411 if (work_pendi= ng(&adev->coredump_work)) 4bbba79a7f1d0c7 Pierre-Eric Pelloux-Prayer 2025-02-21 412 return; 4bbba79a7f1d0c7 Pierre-Eric Pelloux-Prayer 2025-02-21 413 =20 32ab301b89b30d7 Pierre-Eric Pelloux-Prayer 2026-02-04 @414 if (job && job= ->pasid) 32ab301b89b30d7 Pierre-Eric Pelloux-Prayer 2026-02-04 415 size +=3D siz= eof(struct amdgpu_coredump_ib_info) * job->num_ibs; 32ab301b89b30d7 Pierre-Eric Pelloux-Prayer 2026-02-04 416 =20 32ab301b89b30d7 Pierre-Eric Pelloux-Prayer 2026-02-04 417 coredump =3D k= zalloc(size, GFP_NOWAIT); e29172987309526 Mario Limonciello (AMD 2025-12-14 418) if (!coredump) 9022f01b9709331 Sunil Khatri 2024-03-21 419 return; 9022f01b9709331 Sunil Khatri 2024-03-21 420 =20 6122f5c72e38a88 Trigger Huang 2024-08-19 421 coredump->skip= _vram_check =3D skip_vram_check; 9022f01b9709331 Sunil Khatri 2024-03-21 422 coredump->rese= t_vram_lost =3D vram_lost; 32ab301b89b30d7 Pierre-Eric Pelloux-Prayer 2026-02-04 @423 coredump->pasi= d =3D job->pasid; 9022f01b9709331 Sunil Khatri 2024-03-21 424 =20 8d1a13816e59254 Christian K=C3=B6nig 2024-12-12 @425 if (job &= & job->pasid) { 9022f01b9709331 Sunil Khatri 2024-03-21 426 struct amdgpu= _task_info *ti; 9022f01b9709331 Sunil Khatri 2024-03-21 427 =20 8d1a13816e59254 Christian K=C3=B6nig 2024-12-12 428 ti =3D a= mdgpu_vm_get_task_info_pasid(adev, job->pasid); 9022f01b9709331 Sunil Khatri 2024-03-21 429 if (ti) { 9022f01b9709331 Sunil Khatri 2024-03-21 430 coredump->re= set_task_info =3D *ti; 9022f01b9709331 Sunil Khatri 2024-03-21 431 amdgpu_vm_pu= t_task_info(ti); 9022f01b9709331 Sunil Khatri 2024-03-21 432 } 32ab301b89b30d7 Pierre-Eric Pelloux-Prayer 2026-02-04 433 coredump->num= _ibs =3D job->num_ibs; 32ab301b89b30d7 Pierre-Eric Pelloux-Prayer 2026-02-04 434 for (i =3D 0;= i < job->num_ibs; ++i) { 32ab301b89b30d7 Pierre-Eric Pelloux-Prayer 2026-02-04 435 coredump->ib= s[i].gpu_addr =3D job->ibs[i].gpu_addr; 32ab301b89b30d7 Pierre-Eric Pelloux-Prayer 2026-02-04 436 coredump->ib= s[i].ib_size_dw =3D job->ibs[i].length_dw; 32ab301b89b30d7 Pierre-Eric Pelloux-Prayer 2026-02-04 437 } 9022f01b9709331 Sunil Khatri 2024-03-21 438 } 9022f01b9709331 Sunil Khatri 2024-03-21 439 =20 9022f01b9709331 Sunil Khatri 2024-03-21 440 if (job) { 9022f01b9709331 Sunil Khatri 2024-03-21 441 s_job =3D &jo= b->base; 9022f01b9709331 Sunil Khatri 2024-03-21 442 coredump->rin= g =3D to_amdgpu_ring(s_job->sched); 9022f01b9709331 Sunil Khatri 2024-03-21 443 } 9022f01b9709331 Sunil Khatri 2024-03-21 444 =20 eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 445 /* Dump ring c= ontent if memory allocation succeeds. */ eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 446 ring_count =3D = 0; eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 447 total_ring_siz= e =3D 0; eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 448 for (i =3D 0; = i < adev->num_rings; i++) { eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 449 ring =3D adev= ->rings[i]; eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 450 =20 eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 451 /* Only dump = rings with unsignalled fences. */ eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 452 if (atomic_re= ad(&ring->fence_drv.last_seq) =3D=3D ring->fence_drv.sync_seq && eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 453 coredump-= >ring !=3D ring) eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 454 continue; eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 455 =20 eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 456 total_ring_si= ze +=3D ring->ring_size; eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 457 ring_count++; eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 458 } eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 459 coredump->ring= s_dw =3D kzalloc(total_ring_size, GFP_NOWAIT); eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 460 coredump->ring= s =3D kcalloc(ring_count, sizeof(struct amdgpu_coredump_ring), GFP_NOWAIT); eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 461 if (coredump->= rings && coredump->rings_dw) { eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 462 for (i =3D 0,= off =3D 0, idx =3D 0; i < adev->num_rings; i++) { eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 463 ring =3D ade= v->rings[i]; eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 464 =20 eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 465 if (atomic_r= ead(&ring->fence_drv.last_seq) =3D=3D ring->fence_drv.sync_seq && eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 466 coredump= ->ring !=3D ring) eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 467 continue; eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 468 =20 eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 469 coredump->ri= ngs[idx].ring_index =3D ring->idx; eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 470 coredump->ri= ngs[idx].rptr =3D amdgpu_ring_get_rptr(ring); eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 471 coredump->ri= ngs[idx].wptr =3D amdgpu_ring_get_wptr(ring); eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 472 coredump->ri= ngs[idx].offset =3D off; eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 473 =20 eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 474 memcpy(&core= dump->rings_dw[off], ring->ring, ring->ring_size); eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 475 off +=3D rin= g->ring_size; eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 476 idx++; eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 477 } eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 478 coredump->num= _rings =3D idx; eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 479 } else { eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 480 kvfree(coredu= mp->rings_dw); eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 481 kvfree(coredu= mp->rings); eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 482 coredump->rin= gs_dw =3D NULL; eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 483 coredump->rin= gs =3D NULL; eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 484 } eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 485 =20 9022f01b9709331 Sunil Khatri 2024-03-21 486 coredump->adev= =3D adev; 9022f01b9709331 Sunil Khatri 2024-03-21 487 =20 9022f01b9709331 Sunil Khatri 2024-03-21 488 ktime_get_ts64= (&coredump->reset_time); 9022f01b9709331 Sunil Khatri 2024-03-21 489 =20 4bbba79a7f1d0c7 Pierre-Eric Pelloux-Prayer 2025-02-21 490 /* Update the = current coredump pointer (no lock needed, this function can only be called 4bbba79a7f1d0c7 Pierre-Eric Pelloux-Prayer 2025-02-21 491 * from a sing= le thread) 4bbba79a7f1d0c7 Pierre-Eric Pelloux-Prayer 2025-02-21 492 */ 4bbba79a7f1d0c7 Pierre-Eric Pelloux-Prayer 2025-02-21 493 adev->coredump= =3D coredump; 4bbba79a7f1d0c7 Pierre-Eric Pelloux-Prayer 2025-02-21 494 /* Kick off co= redump formatting to a worker thread. */ 4bbba79a7f1d0c7 Pierre-Eric Pelloux-Prayer 2025-02-21 495 queue_work(sys= tem_unbound_wq, &adev->coredump_work); 28d05f0836dfc44 Andr=C3=A9 Almeida 2025-02-20 496 =20 28d05f0836dfc44 Andr=C3=A9 Almeida 2025-02-20 497 drm_info(= dev, "AMDGPU device coredump file has been created\n"); 28d05f0836dfc44 Andr=C3=A9 Almeida 2025-02-20 498 drm_info(= dev, "Check your /sys/class/drm/card%d/device/devcoredump/data\n", 28d05f0836dfc44 Andr=C3=A9 Almeida 2025-02-20 499 dev->pr= imary->index); 9022f01b9709331 Sunil Khatri 2024-03-21 500 } 4bbba79a7f1d0c7 Pierre-Eric Pelloux-Prayer 2025-02-21 501 =20 --=20 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (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 A1291330324 for ; Tue, 7 Apr 2026 09:18:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775553484; cv=none; b=nTRxVAeP1TqRaPwy4fNTqu/Z5Q8yLv688cwp8Jqe3rmDq6OU3ufHXekM1J1p+7rXvyV51kp/amQPo2iTTmiS8QGF+lsmou95kF3yyVXvE3VftgmTbIzEViHXrmqsUXPH4xEjpN93f8JdFSIdgwxNR+XZgu6kz/0NOKOtqx7peV0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775553484; c=relaxed/simple; bh=ua6NBcpMsmGxkxsRFCt9qqLfoN5fo54vzR5LLZbWBnQ=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=SZEmt9u5rhmMVCgqDXUu1VnEIC9/hRjDNQ8cl2zNxUR40NupIs7VDUlT24xsEl67u/AHax8Oh3HmOyUEh2B3LxGvujfT9j11qwhSqJV3oAkQPu9V64BHBaaWt5bPPZ/yNPNpLRrfjNn08qBHKM8nT/wFqGAq576gnVgPibZb+PE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=fW4xU8EC; arc=none smtp.client-ip=209.85.221.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fW4xU8EC" Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-43ccda008cdso2906380f8f.0 for ; Tue, 07 Apr 2026 02:18:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775553480; x=1776158280; darn=lists.linux.dev; h=content-transfer-encoding:content-disposition:mime-version :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=7QAXViyT/yNLbimjFZQ0oxVgoLoR8JjMuycPU0pt+qI=; b=fW4xU8ECQ9g/O3fDee+2BQBxvhAxayljz6FdLL3E0zESJkV9CuNGcnQ81e3Z18aN8o 8DmgWxZxIvA1174k2T3xsoMnXpfT5HXPCkUg9ywFJvGclZRCGBQsxQQ6Hcoka482SNKX ir3AnJvu7bP+C+2xhSgmtjddlV7z6VRikzPGc+6RbVysfYEB2VI7HtsMhmYA2uqfHTWs Y/0Xx8S45kzCqRFkYvSqNLtBhitUkv8IuXqazFTuCchPdeatNaB88ss7QH2MVSDvBMCw cPBZlDHGZThDPrUFHl2wgnNfDXfSx2QD7cEK36hroPT7So+6OmCcDmqR7SEJb/ubIoFG 9dTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775553480; x=1776158280; h=content-transfer-encoding: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=7QAXViyT/yNLbimjFZQ0oxVgoLoR8JjMuycPU0pt+qI=; b=S69fn3JRT4desyATc0O/fbeKV01q+aQ1k2XiMfzYb9jrVbqXJrbleH2it0uENOFh/1 O14PiWBOWEMKGgLjWi/NmWrJtz+G5PRrMmd11NULAo5qLRzjH8/YbNmT2+OTNfzWvaoz 5DdoX1JcHh7HhI8beKA1ics1kHx1zhhhCL4UwDUMyJdqSMBxDaRaKQKToTVvgYGWv9J9 YdMcygPm1lPB+UTROG6QQ31a5g9tqf+7Y3Gd+BIj+Vn3XYRYG5RDs/v9q4ASEyJhYu7O eWuJshebBMBYKAR4JiBZ2axT3BUqtn7+Nv8PDex8neksg/ElU4z4mAjlnmnk3JkpYd28 LZ+g== X-Gm-Message-State: AOJu0YyJvU9aVK95G+AgJuwopV9WtwewUAZwHhn4TofwCKd9bVWj7/HC NCYaBOkW7g9MDSOGYgSeQ12tc5ii0IE6VRWbaADMcR0tUq8jC/VnCktYVpQigQ== X-Gm-Gg: AeBDiesyfsdtUmeR3lGGcL5gIGuIonA7Ip5lwyAvZ2WbJdNKuTV2DSpicLPKc5+LZ5l 5OoPWOLRANmBQDoRgbpZUY7+jTOjaEBHIcEEsSDjBdtCLTIumjYuPDzWDPseZo7R9BXPv9fFiuu z8UkrMMggPYc6ZjVEgx5yRSZN2nLOhbyzYaARbqNypJytJhWAmCdsF7aHPRsg0r20lEbY4igHp4 U4uLUSaucz7wEH9f2aJcakVcujhZFmtqq/Ma62K6ZAyKGC/3WpH+Uz614QQlUheHnJqNa0wyjB8 kz8jHguzO47/PFv7YuXT8f1oM0RR2JCfaJuiXGwsSvDgz1f5VKJpOoL4XjNC3cEyDxCAf/vA262 7DfGg9AsXMFuGkp5qwyZSq/FsLiNvPmJpWJLHea0EV7rwmvrmSIHXcSX9RumA74B6iXNbceuyOp 6Hyi+1k0X5p9enLprFElM= X-Received: by 2002:a5d:5847:0:b0:43d:25a6:624 with SMTP id ffacd0b85a97d-43d28fb74abmr24068950f8f.11.1775553479509; Tue, 07 Apr 2026 02:17:59 -0700 (PDT) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43d1e2a6f08sm51421864f8f.6.2026.04.07.02.17.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Apr 2026 02:17:58 -0700 (PDT) Date: Tue, 7 Apr 2026 12:17:55 +0300 From: Dan Carpenter To: oe-kbuild@lists.linux.dev, Pierre-Eric Pelloux-Prayer Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev, Alex Deucher Subject: [agd5f:drm-next-7.1 55/56] drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c:423 amdgpu_coredump() error: we previously assumed 'job' could be null (see line 414) Message-ID: <202604071441.vAPwv1su-lkp@intel.com> Precedence: bulk X-Mailing-List: oe-kbuild@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit Message-ID: <20260407091755.bZLLHEGPug2efXAZAALBaxEmBVMd7-7tYjhuCkHk4Xw@z> tree: https://gitlab.freedesktop.org/agd5f/linux.git drm-next-7.1 head: 7b15fc2d1f1a00fb99f0146e404ff2600999ec74 commit: 32ab301b89b30d71a2e68d86f564eca66f7c52c5 [55/56] drm/amdgpu: store ib info for devcoredump config: x86_64-randconfig-161-20260405 (https://download.01.org/0day-ci/archive/20260407/202604071441.vAPwv1su-lkp@intel.com/config) compiler: gcc-14 (Debian 14.2.0-19) 14.2.0 smatch: v0.5.0-9004-gb810ac53 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/202604071441.vAPwv1su-lkp@intel.com/ smatch warnings: drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c:423 amdgpu_coredump() error: we previously assumed 'job' could be null (see line 414) drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c:425 amdgpu_coredump() warn: variable dereferenced before check 'job' (see line 423) vim +/job +423 drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c 6122f5c72e38a88 Trigger Huang 2024-08-19 399 void amdgpu_coredump(struct amdgpu_device *adev, bool skip_vram_check, 6122f5c72e38a88 Trigger Huang 2024-08-19 400 bool vram_lost, struct amdgpu_job *job) 9022f01b9709331 Sunil Khatri 2024-03-21 401 { 9022f01b9709331 Sunil Khatri 2024-03-21 402 struct drm_device *dev = adev_to_drm(adev); 6122f5c72e38a88 Trigger Huang 2024-08-19 403 struct amdgpu_coredump_info *coredump; 32ab301b89b30d7 Pierre-Eric Pelloux-Prayer 2026-02-04 404 size_t size = sizeof(*coredump); 9022f01b9709331 Sunil Khatri 2024-03-21 405 struct drm_sched_job *s_job; eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 406 u64 total_ring_size, ring_count; eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 407 struct amdgpu_ring *ring; eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 408 int i, off, idx; 9022f01b9709331 Sunil Khatri 2024-03-21 409 4bbba79a7f1d0c7 Pierre-Eric Pelloux-Prayer 2025-02-21 410 /* No need to generate a new coredump if there's one in progress already. */ 4bbba79a7f1d0c7 Pierre-Eric Pelloux-Prayer 2025-02-21 411 if (work_pending(&adev->coredump_work)) 4bbba79a7f1d0c7 Pierre-Eric Pelloux-Prayer 2025-02-21 412 return; 4bbba79a7f1d0c7 Pierre-Eric Pelloux-Prayer 2025-02-21 413 32ab301b89b30d7 Pierre-Eric Pelloux-Prayer 2026-02-04 @414 if (job && job->pasid) ^^^ Can job be NULL? 32ab301b89b30d7 Pierre-Eric Pelloux-Prayer 2026-02-04 415 size += sizeof(struct amdgpu_coredump_ib_info) * job->num_ibs; 32ab301b89b30d7 Pierre-Eric Pelloux-Prayer 2026-02-04 416 32ab301b89b30d7 Pierre-Eric Pelloux-Prayer 2026-02-04 417 coredump = kzalloc(size, GFP_NOWAIT); e29172987309526 Mario Limonciello (AMD 2025-12-14 418) if (!coredump) 9022f01b9709331 Sunil Khatri 2024-03-21 419 return; 9022f01b9709331 Sunil Khatri 2024-03-21 420 6122f5c72e38a88 Trigger Huang 2024-08-19 421 coredump->skip_vram_check = skip_vram_check; 9022f01b9709331 Sunil Khatri 2024-03-21 422 coredump->reset_vram_lost = vram_lost; 32ab301b89b30d7 Pierre-Eric Pelloux-Prayer 2026-02-04 @423 coredump->pasid = job->pasid; ^^^^^^^^^^ Unchecked dereference 9022f01b9709331 Sunil Khatri 2024-03-21 424 8d1a13816e59254 Christian König 2024-12-12 @425 if (job && job->pasid) { ^^^ The next line assumes it can be NULL again. 9022f01b9709331 Sunil Khatri 2024-03-21 426 struct amdgpu_task_info *ti; 9022f01b9709331 Sunil Khatri 2024-03-21 427 8d1a13816e59254 Christian König 2024-12-12 428 ti = amdgpu_vm_get_task_info_pasid(adev, job->pasid); 9022f01b9709331 Sunil Khatri 2024-03-21 429 if (ti) { 9022f01b9709331 Sunil Khatri 2024-03-21 430 coredump->reset_task_info = *ti; 9022f01b9709331 Sunil Khatri 2024-03-21 431 amdgpu_vm_put_task_info(ti); 9022f01b9709331 Sunil Khatri 2024-03-21 432 } 32ab301b89b30d7 Pierre-Eric Pelloux-Prayer 2026-02-04 433 coredump->num_ibs = job->num_ibs; 32ab301b89b30d7 Pierre-Eric Pelloux-Prayer 2026-02-04 434 for (i = 0; i < job->num_ibs; ++i) { 32ab301b89b30d7 Pierre-Eric Pelloux-Prayer 2026-02-04 435 coredump->ibs[i].gpu_addr = job->ibs[i].gpu_addr; 32ab301b89b30d7 Pierre-Eric Pelloux-Prayer 2026-02-04 436 coredump->ibs[i].ib_size_dw = job->ibs[i].length_dw; 32ab301b89b30d7 Pierre-Eric Pelloux-Prayer 2026-02-04 437 } 9022f01b9709331 Sunil Khatri 2024-03-21 438 } 9022f01b9709331 Sunil Khatri 2024-03-21 439 9022f01b9709331 Sunil Khatri 2024-03-21 440 if (job) { 9022f01b9709331 Sunil Khatri 2024-03-21 441 s_job = &job->base; 9022f01b9709331 Sunil Khatri 2024-03-21 442 coredump->ring = to_amdgpu_ring(s_job->sched); 9022f01b9709331 Sunil Khatri 2024-03-21 443 } 9022f01b9709331 Sunil Khatri 2024-03-21 444 eea85914d15bfe3 Pierre-Eric Pelloux-Prayer 2026-02-04 445 /* Dump ring content if memory allocation succeeds. */ -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki