linux-stable/drivers
Arnd Bergmann 014d15b8f3 drm/amdgpu: avoid integer overflow warning in amdgpu_device_resize_fb_bar()
[ Upstream commit 822130b5e8 ]

On 32-bit architectures comparing a resource against a value larger than
U32_MAX can cause a warning:

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1344:18: error: result of comparison of constant 4294967296 with expression of type 'resource_size_t' (aka 'unsigned int') is always false [-Werror,-Wtautological-constant-out-of-range-compare]
                    res->start > 0x100000000ull)
                    ~~~~~~~~~~ ^ ~~~~~~~~~~~~~~

As gcc does not warn about this in dead code, add an IS_ENABLED() check at
the start of the function. This will always return success but not actually resize
the BAR on 32-bit architectures without high memory, which is exactly what
we want here, as the driver can fall back to bank switching the VRAM
access.

Fixes: 31b8adab32 ("drm/amdgpu: require a root bus window above 4GB for BAR resize")
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-09-23 10:48:02 +02:00
..
accessibility
acpi treewide: Remove uninitialized_var() usage 2023-08-11 11:45:01 +02:00
amba
android binder: fix memory leak in binder_init() 2023-08-16 18:13:00 +02:00
ata ata: pata_ns87415: mark ns87560_tf_read static 2023-08-11 11:45:32 +02:00
atm treewide: Remove uninitialized_var() usage 2023-08-11 11:45:01 +02:00
auxdisplay
base regmap: rbtree: Use alloc_flags for memory allocations 2023-09-23 10:48:00 +02:00
bcma
block loop: Select I/O scheduler 'none' from inside add_disk() 2023-08-11 11:45:36 +02:00
bluetooth Bluetooth: nokia: fix value check in nokia_bluetooth_serdev_probe() 2023-09-23 10:48:00 +02:00
bus bus: imx-weim: fix branch condition evaluates to a garbage value 2023-04-05 11:15:38 +02:00
cdrom
char tpm_tis: Explicitly check for error code 2023-08-11 11:45:34 +02:00
clk treewide: Remove uninitialized_var() usage 2023-08-11 11:45:01 +02:00
clocksource clocksource/drivers/cadence-ttc: Fix memory leak in ttc_timer_probe 2023-08-11 11:45:02 +02:00
connector
cpufreq cpufreq: powernow-k8: Use related_cpus instead of cpus in driver.exit() 2023-09-23 10:48:00 +02:00
cpuidle cpuidle: dt: Return the correct numbers of parsed idle states 2023-01-18 11:30:04 +01:00
crypto crypto: caam - fix unchecked return value error 2023-09-23 10:48:00 +02:00
dax
dca
devfreq
dio drivers: dio: fix possible memory leak in dio_init() 2023-01-18 11:30:23 +01:00
dma idmaengine: make FSL_EDMA and INTEL_IDMA64 depends on HAS_IOMEM 2023-09-23 10:47:58 +02:00
dma-buf dma-buf/sw_sync: Avoid recursive lock during fence signal 2023-08-30 16:31:56 +02:00
edac EDAC/skx: Fix overflows on the DRAM row address mapping arrays 2023-05-17 11:13:09 +02:00
eisa
extcon extcon: Fix kernel doc of property capability fields to avoid warnings 2023-08-11 11:45:12 +02:00
firewire treewide: Remove uninitialized_var() usage 2023-08-11 11:45:01 +02:00
firmware firmware: arm_sdei: Fix sleep from invalid context BUG 2023-05-30 12:42:08 +01:00
fmc
fpga fpga: bridge: fix kernel-doc parameter description 2023-05-17 11:13:15 +02:00
fsi fsi: master-ast-cf: Add MODULE_FIRMWARE macro 2023-09-23 10:47:57 +02:00
gnss
gpio gpio: tps68470: Make tps68470_gpio_output() always set the initial value 2023-08-11 11:45:27 +02:00
gpu drm/amdgpu: avoid integer overflow warning in amdgpu_device_resize_fb_bar() 2023-09-23 10:48:02 +02:00
hid HID: wacom: remove the battery when the EKR is off 2023-09-23 10:47:56 +02:00
hsi HSI: omap_ssi_core: Fix error handling in ssi_init() 2023-01-18 11:30:30 +01:00
hv Drivers: hv: vmbus: Fix vmbus_wait_for_unload() to scan present CPUs 2023-06-28 10:15:28 +02:00
hwmon hwmon: (nct7802) Fix for temp6 (PECI1) processed even if PECI1 disabled 2023-08-11 11:45:34 +02:00
hwspinlock
hwtracing coresight: Fix signedness bug in tmc_etr_buf_insert_barrier_packet() 2023-05-30 12:42:15 +01:00
i2c i2c: xiic: Don't try to handle more interrupt events after error 2023-08-11 11:45:14 +02:00
ide treewide: Remove uninitialized_var() usage 2023-08-11 11:45:01 +02:00
idle intel_idle: Disable IBRS during long idle 2022-11-23 07:53:45 +01:00
iio iio: addac: stx104: Fix race condition when converting analog-to-digital 2023-08-30 16:31:44 +02:00
infiniband IB/hfi1: Fix possible panic during hotplug remove 2023-08-16 18:13:00 +02:00
input Input: adxl34x - do not hardcode interrupt trigger type 2023-08-11 11:45:08 +02:00
iommu iommu/mediatek-v1: Fix an error handling path in mtk_iommu_v1_probe() 2023-01-18 11:30:55 +01:00
ipack
irqchip irqchip/mips-gic: Don't touch vl_map if a local interrupt is not routable 2023-08-30 16:31:56 +02:00
isdn mISDN: Update parameter type of dsp_cmx_send() 2023-08-16 18:13:00 +02:00
leds
lightnvm
macintosh macintosh: via-pmu-led: requires ATA to be set 2023-05-17 11:13:18 +02:00
mailbox mailbox: ti-msgmgr: Fill non-message tx data fields with 0x0 2023-08-11 11:45:13 +02:00
mcb mcb-pci: Reallocate memory region to avoid memory overlapping 2023-05-30 12:42:09 +01:00
md dm integrity: reduce vmalloc space footprint on 32-bit architectures 2023-08-30 16:31:53 +02:00
media media: vcodec: Fix potential array out-of-bounds in encoder queue_setup 2023-08-30 16:31:55 +02:00
memory memory: of: Fix refcount leak bug in of_get_ddr_timings() 2022-10-26 13:19:28 +02:00
memstick memstick r592: make memstick_debug_get_tpc_name() static 2023-08-11 11:45:06 +02:00
message scsi: message: mptlan: Fix use after free bug in mptlan_remove() due to race condition 2023-05-30 12:42:09 +01:00
mfd mfd: stmpe: Only disable the regulators if they are enabled 2023-08-11 11:45:13 +02:00
misc misc: pci_endpoint_test: Re-init completion for every test 2023-08-11 11:45:21 +02:00
mmc mmc: au1xmmc: force non-modular build and remove symbol_get usage 2023-09-23 10:47:56 +02:00
mtd mtd: rawnand: omap_elm: Fix incorrect type in assignment 2023-08-11 11:45:39 +02:00
mux
net net: arcnet: Do not call kfree_skb() under local_irq_disable() 2023-09-23 10:48:01 +02:00
nfc nfcsim.c: Fix error checking for debugfs_create_dir 2023-06-28 10:15:31 +02:00
ntb NTB: ntb_tool: Add check for devm_kcalloc 2023-08-11 11:45:19 +02:00
nubus
nvdimm
nvme nvmet: avoid potential UAF in nvmet_req_complete() 2023-03-22 13:27:09 +01:00
nvmem
of of: Fix modalias string generation 2023-05-17 11:13:16 +02:00
opp
oprofile
parisc parisc: led: Fix potential null-ptr-deref in start_task() 2023-01-18 11:30:44 +01:00
parport parport_pc: Avoid FIFO port location truncation 2022-11-25 17:40:23 +01:00
pci PCI: acpiphp: Use pci_assign_unassigned_bridge_resources() only for non-root bus 2023-08-30 16:31:55 +02:00
pcmcia pcmcia: rsrc_nonstatic: Fix memory leak in nonstatic_release_resource_db() 2023-08-30 16:31:43 +02:00
perf perf: arm_dsu: Fix hotplug callback leak in dsu_pmu_init() 2023-01-18 11:30:02 +01:00
phy phy: hisilicon: Fix an out of bounds check in hisi_inno_phy_probe() 2023-08-11 11:45:30 +02:00
pinctrl pinctrl: amd: Don't show `Invalid config param` errors 2023-09-23 10:47:57 +02:00
platform platform/x86: intel: hid: Always call BTNL ACPI method 2023-09-23 10:47:58 +02:00
pnp PNP: fix name memory leak in pnp_alloc_dev() 2023-01-18 11:30:05 +01:00
power power: supply: Fix logic checking if system is running from battery 2023-06-21 15:39:56 +02:00
powercap powercap: fix possible name leak in powercap_register_zone() 2023-03-11 16:31:36 +01:00
pps
ps3
ptp
pwm pwm: mtk-disp: Disable shadow registers before setting backlight values 2023-05-17 11:13:20 +02:00
rapidio rapidio: devices: fix missing put_device in mport_cdev_open 2023-01-18 11:30:08 +01:00
ras
regulator regulator: Fix error checking for debugfs_create_dir 2023-06-21 15:39:56 +02:00
remoteproc remoteproc: qcom: wcnss: Fix handling of IRQs 2022-08-25 11:15:21 +02:00
reset
rpmsg rpmsg: glink: Avoid infinite loop on intent for missing channel 2023-03-11 16:31:45 +01:00
rtc rtc: ds1685: use EXPORT_SYMBOL_GPL for ds1685_rtc_poweroff 2023-09-23 10:47:56 +02:00
s390 s390/dasd: fix hanging device after request requeue 2023-09-23 10:47:57 +02:00
sbus
scsi scsi: qedi: Fix potential deadlock on &qedi_percpu->p_work_lock 2023-09-23 10:47:58 +02:00
sfi
sh
siox siox: fix possible memory leak in siox_device_add() 2022-11-25 17:40:23 +01:00
slimbus slimbus: stream: correct presence rate frequencies 2022-11-25 17:40:25 +01:00
sn
soc soc/fsl/qe: fix usb.c build errors 2023-08-11 11:45:08 +02:00
soundwire soundwire: bus_type: fix remove and shutdown support 2022-08-25 11:15:15 +02:00
spi spi: tegra20-sflash: fix to check return value of platform_get_irq() in tegra_sflash_probe() 2023-09-23 10:48:00 +02:00
spmi spmi: Add a check for remove callback when removing a SPMI driver 2023-05-17 11:13:17 +02:00
ssb treewide: Remove uninitialized_var() usage 2023-08-11 11:45:01 +02:00
staging erofs: ensure that the post-EOF tails are all zeroed 2023-09-23 10:47:56 +02:00
target scsi: target: iscsi: Prevent login threads from racing between each other 2023-06-28 10:15:30 +02:00
tc
tee tee: add overflow check in register_shm_helper() 2022-08-25 11:15:48 +02:00
thermal thermal: intel: powerclamp: Fix cur_state for multi package system 2023-03-11 16:32:02 +01:00
thunderbolt thunderbolt: Use const qualifier for `ring_interrupt_index` 2023-04-05 11:15:35 +02:00
tty serial: sc16is7xx: fix bug when first setting GPIO direction 2023-09-23 10:47:57 +02:00
uio uio: uio_dmem_genirq: Fix deadlock between irq config and handling 2023-01-18 11:30:25 +01:00
usb USB: serial: option: add FOXCONN T99W368/T99W373 product 2023-09-23 10:47:56 +02:00
uwb
vfio vfio: platform: Do not pass return buffer to ACPI _RST method 2023-01-18 11:30:25 +01:00
vhost treewide: Remove uninitialized_var() usage 2023-08-11 11:45:01 +02:00
video fbdev: fix potential OOB read in fast_imageblit() 2023-08-30 16:31:52 +02:00
virt vboxguest: Do not use devm for irq 2022-08-25 11:15:43 +02:00
virtio virtio-mmio: don't break lifecycle of vm_dev 2023-08-30 16:31:47 +02:00
visorbus
vlynq
vme vme: Fix error not catched in fake_init() 2023-01-18 11:30:28 +01:00
w1 w1: fix loop in w1_fini() 2023-08-11 11:45:11 +02:00
watchdog watchdog: menz069_wdt: fix watchdog initialisation 2023-06-09 10:23:57 +02:00
xen xen/pvcalls-back: fix double frees with pvcalls_new_active_socket() 2023-05-30 12:42:15 +01:00
zorro
Kconfig
Makefile