summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvy Lopez <skunkolee@gmail.com>2026-09-08 18:28:29 -0600
committerJakub Kicinski <kuba@kernel.org>2026-09-10 17:31:35 -0700
commitf5f0fcfcb30c677c1069c131f8e00e728e0a4fc5 (patch)
tree315d54175b43e1184404dda4bbb5a955fd1465ba
parent99d76b4da88f21edd14b169f65de33e8df1b7804 (diff)
downloadlinux-next-f5f0fcfcb30c677c1069c131f8e00e728e0a4fc5.tar.gz
linux-next-f5f0fcfcb30c677c1069c131f8e00e728e0a4fc5.zip
net: starfire: fix ioaddr sign-extension causing ioremap() failure
ioaddr is declared as a signed long, but is assigned the result of pci_resource_start(), which returns an unsigned resource_size_t. On configurations where the BAR address has its high bit set, the value sign-extends when passed to ioremap(), producing a bogus 64-bit address and causing device probe to fail: ioremap: invalid physical address fffffffffe480000 starfire 0000:08:04.0: cannot Remap 0x80000 @ 0xfe480000, aborting Change ioaddr to resource_size_t, matching both the return type of pci_resource_start() and the type ioremap() expects for its physical address argument, rather than unsigned long, which is not guaranteed to be wide enough on all configurations. Switch the associated error print to %pa accordingly. Link: https://bugzilla.kernel.org/show_bug.cgi?id=198035 Signed-off-by: Ivy Lopez <skunkolee@gmail.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20260909002829.224639-1-skunkolee@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r--drivers/net/ethernet/adaptec/starfire.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/ethernet/adaptec/starfire.c b/drivers/net/ethernet/adaptec/starfire.c
index f1109d90e1fc..b2f3998e128b 100644
--- a/drivers/net/ethernet/adaptec/starfire.c
+++ b/drivers/net/ethernet/adaptec/starfire.c
@@ -634,7 +634,7 @@ static int starfire_init_one(struct pci_dev *pdev,
int i, irq, chip_idx = ent->driver_data;
struct net_device *dev;
u8 addr[ETH_ALEN];
- long ioaddr;
+ resource_size_t ioaddr;
void __iomem *base;
int drv_flags, io_size;
int boguscnt;
@@ -664,8 +664,8 @@ static int starfire_init_one(struct pci_dev *pdev,
base = ioremap(ioaddr, io_size);
if (!base) {
- dev_err(d, "cannot remap %#x @ %#lx, aborting\n",
- io_size, ioaddr);
+ dev_err(d, "cannot remap %#x @ %pa, aborting\n",
+ io_size, &ioaddr);
goto err_out_free_res;
}