Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2232268/?format=api
{ "id": 2232268, "url": "http://patchwork.ozlabs.org/api/patches/2232268/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260504074823.99377-1-w15303746062@163.com/", "project": { "id": 28, "url": "http://patchwork.ozlabs.org/api/projects/28/?format=api", "name": "Linux PCI development", "link_name": "linux-pci", "list_id": "linux-pci.vger.kernel.org", "list_email": "linux-pci@vger.kernel.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260504074823.99377-1-w15303746062@163.com>", "list_archive_url": null, "date": "2026-05-04T07:48:23", "name": "[v2] char: agp: amd64 - fix broken error propagation in agp_amd64_probe()", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "57e28ee041edc3e94e5533c3b5f19aca1d3ffec6", "submitter": { "id": 93320, "url": "http://patchwork.ozlabs.org/api/people/93320/?format=api", "name": null, "email": "w15303746062@163.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260504074823.99377-1-w15303746062@163.com/mbox/", "series": [ { "id": 502621, "url": "http://patchwork.ozlabs.org/api/series/502621/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-pci/list/?series=502621", "date": "2026-05-04T07:48:23", "name": "[v2] char: agp: amd64 - fix broken error propagation in agp_amd64_probe()", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/502621/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2232268/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2232268/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linux-pci+bounces-53661-incoming=patchwork.ozlabs.org@vger.kernel.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "linux-pci@vger.kernel.org" ], "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=163.com header.i=@163.com header.a=rsa-sha256\n header.s=s110527 header.b=H7olWS5R;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c15:e001:75::12fc:5321; helo=sin.lore.kernel.org;\n envelope-from=linux-pci+bounces-53661-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (1024-bit key) header.d=163.com header.i=@163.com\n header.b=\"H7olWS5R\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=117.135.210.2", "smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=163.com", "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=163.com" ], "Received": [ "from sin.lore.kernel.org (sin.lore.kernel.org\n [IPv6:2600:3c15:e001:75::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g8DLr2CGzz1yJ9\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 04 May 2026 17:49:40 +1000 (AEST)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sin.lore.kernel.org (Postfix) with ESMTP id BE5513001598\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 4 May 2026 07:49:09 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 79DAE30F957;\n\tMon, 4 May 2026 07:49:08 +0000 (UTC)", "from m16.mail.163.com (m16.mail.163.com [117.135.210.2])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 0A2883064B5;\n\tMon, 4 May 2026 07:49:03 +0000 (UTC)", "from wmy.localdomain (unknown [])\n\tby gzga-smtp-mtada-g0-4 (Coremail) with SMTP id\n _____wDXP31IT_hp5Vw+DQ--.51144S2;\n\tMon, 04 May 2026 15:48:36 +0800 (CST)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777880948; cv=none;\n b=fafoP5OdndC9Ykaky7pTFvURmgle2aEmyto6hBIp1hRBncz6O51CDjgwjFdhwDNjppnPdYFdpXykO54UyvgxoM2LELnYZICvbGWNtRbGSUUqc+kDPytX1avdlOX+hw8PPBQ/r3IqyX07rSKWFOwC29F5DXPyd1zcwOqAwo8AZTE=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777880948; c=relaxed/simple;\n\tbh=V7xSpYLUltDLUB7S/I3rVJ4BaJ/OuF26OVtn7+/zfmo=;\n\th=From:To:Cc:Subject:Date:Message-Id:MIME-Version;\n b=slx7MXaFsWF/rJBTE3QmXZt1R7YD7R/zIad4yGQjh0cQn7AE3Zsc1dhSlLZbybi+FjaLtjER9ucUiArK/mdO+7MdXYygCDMR3iQ8ckbVfm2jR/cRr6zyjtFvobOeXTEJGFXahbaKxbiyer96igcqzk/UTkOy1g4HO4ZJkQHF78Q=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=163.com;\n spf=pass smtp.mailfrom=163.com;\n dkim=pass (1024-bit key) header.d=163.com header.i=@163.com\n header.b=H7olWS5R; arc=none smtp.client-ip=117.135.210.2", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com;\n\ts=s110527; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=BG\n\t2utFDGULuhQh672bTQWamHdZY+4eC37jgZ9SY1idg=; b=H7olWS5RZg7vQT1sno\n\tc2iSGZnhunC5zuuMpS042oREnPlUBbZ7VeQGSGP4syeZfS2+GA3RYkYsTd0peFo5\n\tpfHaB9gP1ADxF1fHUeAQkX3goD+T9GvbWGvTMLYBmVlzxUjg+RQYE1bbelCV7P1u\n\tHb3bwr7FAr4jYYInHdI35jzqI=", "From": "w15303746062@163.com", "To": "airlied@redhat.com", "Cc": "dri-devel@lists.freedesktop.org,\n\tlinux-kernel@vger.kernel.org,\n\tx86@kernel.org,\n\tlinux-pci@vger.kernel.org,\n\tMingyu Wang <25181214217@stu.xidian.edu.cn>", "Subject": "[PATCH v2] char: agp: amd64 - fix broken error propagation in\n agp_amd64_probe()", "Date": "Mon, 4 May 2026 15:48:23 +0800", "Message-Id": "<20260504074823.99377-1-w15303746062@163.com>", "X-Mailer": "git-send-email 2.34.1", "Precedence": "bulk", "X-Mailing-List": "linux-pci@vger.kernel.org", "List-Id": "<linux-pci.vger.kernel.org>", "List-Subscribe": "<mailto:linux-pci+subscribe@vger.kernel.org>", "List-Unsubscribe": "<mailto:linux-pci+unsubscribe@vger.kernel.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-CM-TRANSID": "_____wDXP31IT_hp5Vw+DQ--.51144S2", "X-Coremail-Antispam": "1Uf129KBjvJXoW7Cr15CFy3AFWxGryrXF1DZFb_yoW8tF1fpa\n\t93GwsYka1kK34rKFWDtw47Ar1Fvwn7WFWYkr1kGw4DuasxGFyxAry3tFWj9Fy5CFWqyr4a\n\tv3W5KFW5ua4DAaDanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2\n\t9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jFg4fUUUUU=", "X-CM-SenderInfo": "jzrvjiatxuliiws6il2tof0z/xtbC5BSBZWn4T1RBhAAA3b" }, "content": "From: Mingyu Wang <25181214217@stu.xidian.edu.cn>\n\nA NULL pointer dereference was observed in the AMD64 AGP driver when\nrunning in a virtualized environment (e.g., QEMU/KVM) without a physical\nAMD Northbridge. The crash occurs in amd64_fetch_size() when attempting\nto dereference the pointer returned by node_to_amd_nb(0).\n\nThe root cause of this crash is broken error propagation in\nagp_amd64_probe(). When no AMD Northbridges are found, cache_nbs()\ncorrectly returns -ENODEV. However, the probe function erroneously\nchecked the return value against exactly -1, rather than < 0.\n\nAs a result, the hardware absence error was masked, allowing the driver\nto improperly proceed with initialization. It eventually called\nagp_add_bridge(), which invokes amd64_fetch_size(). Since the hardware\ndoes not exist, node_to_amd_nb(0) returns NULL, leading to a General\nProtection Fault (GPF) when accessing its ->misc member.\n\nFix the issue by correcting the error check in agp_amd64_probe() to\nabort properly when cache_nbs() returns any negative error code. This\nprevents the driver from erroneously proceeding without hardware, thereby\nresolving the subsequent NULL pointer dereference at its source.\n\nSigned-off-by: Mingyu Wang <25181214217@stu.xidian.edu.cn>\n---\n+ Changes in v2:\n+ - Dropped redundant NULL pointer checks in various initialization functions.\n+ - Fixed the actual root cause: broken error propagation in agp_amd64_probe() \n+ where it erroneously checked cache_nbs() against exactly -1 instead of < 0.\n+ (Thanks to Sashiko AI for the review feedback).\n+\n drivers/char/agp/amd64-agp.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)", "diff": "diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c\nindex 2505df1f4e69..6741270e0a98 100644\n--- a/drivers/char/agp/amd64-agp.c\n+++ b/drivers/char/agp/amd64-agp.c\n@@ -546,7 +546,7 @@ static int agp_amd64_probe(struct pci_dev *pdev,\n \t/* Fill in the mode register */\n \tpci_read_config_dword(pdev, bridge->capndx+PCI_AGP_STATUS, &bridge->mode);\n \n-\tif (cache_nbs(pdev, cap_ptr) == -1) {\n+\tif (cache_nbs(pdev, cap_ptr) < 0) {\n \t\tagp_put_bridge(bridge);\n \t\treturn -ENODEV;\n \t}\n", "prefixes": [ "v2" ] }