Commit d58e805e authored by John Thomson's avatar John Thomson Committed by liwei
Browse files

PCI: mt7621: Add sentinel to quirks table

mainline inclusion
from mainline-v6.2-rc1
commit 19098934
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAYRFS

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=19098934f910b4d47cb30251dd39ffa57bef9523

-------------------------------------------------

Current driver is missing a sentinel in the struct soc_device_attribute
array, which causes an oops when assessed by the
soc_device_match(mt7621_pcie_quirks_match) call.

This was only exposed once the CONFIG_SOC_MT7621 mt7621 soc_dev_attr
was fixed to register the SOC as a device, in:

commit 7c18b64b ("mips: ralink: mt7621: do not use kzalloc too early")

Fix it by adding the required sentinel.

Link: https://lore.kernel.org/lkml/26ebbed1-0fe9-4af9-8466-65f841d0b382@app.fastmail.com
Link: https://lore.kernel.org/r/20221205204645.301301-1-git@johnthomson.fastmail.com.au


Fixes: b483b4e4 ("staging: mt7621-pci: add quirks for 'E2' revision using 'soc_device_attribute'")
Signed-off-by: default avatarJohn Thomson <git@johnthomson.fastmail.com.au>
Signed-off-by: default avatarLorenzo Pieralisi <lpieralisi@kernel.org>
Acked-by: default avatarSergio Paracuellos <sergio.paracuellos@gmail.com>

Conflicts:
	drivers/pci/controller/pcie-mt7621.c
	drivers/staging/mt7621-pci/pci-mt7621.c
[commit 4793895f("PCI: mt7621: Rename mt7621_pci_ to mt7621_pcie_") was not merged]
Signed-off-by: default avatarliwei <liwei728@huawei.com>
parent 5dabb43a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -677,7 +677,8 @@ static int mt7621_pcie_register_host(struct pci_host_bridge *host,
}

static const struct soc_device_attribute mt7621_pci_quirks_match[] = {
	{ .soc_id = "mt7621", .revision = "E2" }
	{ .soc_id = "mt7621", .revision = "E2" },
	{ /* sentinel */ }
};

static int mt7621_pci_probe(struct platform_device *pdev)