android_kernel_samsung_sm8650/drivers
Su Hui 436785a207 wifi: rtlwifi: rtl8821ae: phy: fix an undefined bitwise shift behavior
[ Upstream commit bc8263083af60e7e57c6120edbc1f75d6c909a35 ]

Clang static checker warns:

drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c:184:49:
	The result of the left shift is undefined due to shifting by '32',
	which is greater or equal to the width of type 'u32'.
	[core.UndefinedBinaryOperatorResult]

If the value of the right operand is negative or is greater than or
equal to the width of the promoted left operand, the behavior is
undefined.[1][2]

For example, when using different gcc's compilation optimization options
(-O0 or -O2), the result of '(u32)data << 32' is different. One is 0, the
other is old value of data. Let _rtl8821ae_phy_calculate_bit_shift()'s
return value less than 32 to fix this problem. Warn if bitmask is zero.

[1] https://stackoverflow.com/questions/11270492/what-does-the-c-standard-say-about-bitshifting-more-bits-than-the-width-of-type
[2] https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf

Fixes: 21e4b0726d ("rtlwifi: rtl8821ae: Move driver from staging to regular tree")
Signed-off-by: Su Hui <suhui@nfschina.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20231127013511.26694-2-suhui@nfschina.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-01-25 15:27:24 -08:00
..
accessibility
acpi ACPI: extlog: Clear Extended Error Log status when RAS_CEC handled the error 2024-01-25 15:27:21 -08:00
amba amba: bus: fix refcount leak 2023-09-13 09:42:56 +02:00
android binder: fix comment on binder_alloc_new_buf() return value 2024-01-20 11:50:10 +01:00
ata scsi: sd: Fix system start for ATA devices 2023-12-08 08:51:14 +01:00
atm atm: solos-pci: Fix potential deadlock on &tx_queue_lock 2023-12-20 17:00:16 +01:00
auxdisplay auxdisplay: hd44780: move cursor home after clear display command 2023-12-08 08:51:16 +01:00
base mm/memory_hotplug: add missing mem_hotplug_lock 2024-01-10 17:10:33 +01:00
bcma
block virtio_blk: fix snprintf truncation compiler warning 2024-01-20 11:50:09 +01:00
bluetooth Bluetooth: Fix deadlock in vhci_send_frame 2024-01-01 12:38:57 +00:00
bus bus: ti-sysc: Flush posted write only after srst_udelay 2024-01-01 12:39:07 +00:00
cdrom
char hwrng: geode - fix accessing registers 2023-11-20 11:52:04 +01:00
clk clk: rockchip: rk3128: Fix HCLK_OTG gate register 2024-01-20 11:50:06 +01:00
clocksource clocksource/drivers/timer-atmel-tcb: Fix initialization on SAM9 hardware 2023-11-28 17:06:55 +00:00
comedi
connector
counter counter: microchip-tcb-capture: Fix the use of internal GCLK logic 2023-10-19 23:08:58 +02:00
cpufreq cpufreq: scmi: process the result of devm_of_clk_add_hw_provider() 2024-01-25 15:27:20 -08:00
cpuidle powerpc/pseries: Rework lppaca_shared_proc() to avoid DEBUG_PREEMPT 2023-09-13 09:42:48 +02:00
crypto crypto: sahara - do not resize req->src when doing hash operations 2024-01-25 15:27:23 -08:00
cxl cxl/port: Fix NULL pointer access in devm_cxl_add_port() 2023-11-28 17:07:23 +00:00
dax
dca
devfreq PM / devfreq: rockchip-dfi: Make pmu regmap mandatory 2023-11-20 11:51:54 +01:00
dio
dma dmaengine: stm32-dma: avoid bitfield overflow assertion 2023-12-20 17:00:25 +01:00
dma-buf dma-buf: fix check in dma_resv_add_fence 2023-12-08 08:51:15 +01:00
edac EDAC/thunderx: Fix possible out-of-bounds string access 2024-01-25 15:27:18 -08:00
eisa
extcon extcon: cht_wc: add POWER_SUPPLY dependency 2023-09-13 09:42:53 +02:00
firewire firewire: ohci: suppress unexpected system reboot in AMD Ryzen machines and ASM108x/VT630x PCIe cards 2024-01-10 17:10:35 +01:00
firmware firmware: meson_sm: populate platform devices from sm device tree data 2024-01-25 15:27:24 -08:00
fpga
fsi fsi: aspeed: Reset master errors after CFAM reset 2023-09-13 09:42:54 +02:00
gnss
gpio gpio: dwapb: mask/unmask IRQ when disable/enale it 2024-01-01 12:39:07 +00:00
gpu drm/crtc: fix uninitialized variable use 2024-01-20 11:50:09 +01:00
greybus
hid HID: nintendo: Prevent divide-by-zero on code 2024-01-20 11:50:09 +01:00
hsi
hte hte: tegra: Fix missing error code in tegra_hte_test_probe() 2023-11-20 11:51:58 +01:00
hv Drivers: hv: vmbus: Don't dereference ACPI root object handle 2023-09-13 09:42:59 +02:00
hwmon hwmon: (corsair-psu) Fix probe when built-in 2024-01-20 11:50:06 +01:00
hwspinlock hwspinlock: qcom: add missing regmap config for SFPB MMIO implementation 2023-09-19 12:28:05 +02:00
hwtracing coresight: etm4x: Fix width of CCITMIN field 2024-01-20 11:50:11 +01:00
i2c i2c: rk3x: fix potential spinlock recursion on poll 2024-01-20 11:50:09 +01:00
i3c i3c: master: svc: fix random hot join failure since timeout error 2023-11-28 17:07:17 +00:00
idle intel_idle: add Emerald Rapids Xeon support 2023-10-10 22:00:44 +02:00
iio iio: imu: adis16475: add spi_device_id table 2024-01-05 15:18:37 +01:00
infiniband RDMA/irdma: Avoid free the non-cqp_request scratch 2023-12-13 18:39:15 +01:00
input Input: xpad - add Razer Wolverine V2 support 2024-01-20 11:50:08 +01:00
interconnect Revert "interconnect: qcom: sm8250: Enable sync_state" 2024-01-10 17:10:37 +01:00
iommu iommu: Avoid more races around device probe 2023-12-13 18:39:17 +01:00
ipack
irqchip irqchip/stm32-exti: add missing DT IRQ flag translation 2023-11-08 14:10:57 +01:00
isdn mISDN: Update parameter type of dsp_cmx_send() 2023-08-16 18:27:26 +02:00
leds leds: ledtrig-tty: Free allocated ttyname buffer on deactivate 2024-01-20 11:50:11 +01:00
macintosh
mailbox mailbox: qcom-ipcc: fix incorrect num_chans counting 2023-09-19 12:27:58 +02:00
mcb mcb: fix error handling for different scenarios when parsing 2023-11-28 17:07:13 +00:00
md Revert "md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d" 2024-01-20 11:50:10 +01:00
media media: qcom: camss: Comment CSID dt_id field 2024-01-10 17:10:37 +01:00
memory
memstick
message
mfd mfd: qcom-spmi-pmic: Fix revid implementation 2023-11-28 17:07:12 +00:00
misc misc: mei: client.c: fix problem of return '-EOVERFLOW' in mei_cl_write 2023-12-13 18:39:23 +01:00
mmc mmc: sdhci-sprd: Fix eMMC init failure after hw reset 2024-01-10 17:10:36 +01:00
most
mtd mtd: Fix gluebi NULL pointer dereference caused by ftl notifier 2024-01-25 15:27:21 -08:00
mux
net wifi: rtlwifi: rtl8821ae: phy: fix an undefined bitwise shift behavior 2024-01-25 15:27:24 -08:00
nfc
ntb ntb: Fix calculation ntb_transport_tx_free_entry() 2023-09-13 09:43:02 +02:00
nubus
nvdimm nd_btt: Make BTT lanes preemptible 2023-11-20 11:52:05 +01:00
nvme nvme: prevent potential spectre v1 gadget 2024-01-20 11:50:06 +01:00
nvmem nvmem: imx: correct nregs for i.MX6UL 2023-11-02 09:35:31 +01:00
of of: dynamic: Fix of_reconfig_get_state_change() return value documentation 2023-12-13 18:39:05 +01:00
opp OPP: Fix passing 0 to PTR_ERR in _opp_attach_genpd() 2023-09-13 09:42:28 +02:00
parisc parisc/power: Fix power soft-off when running on qemu 2023-11-28 17:07:14 +00:00
parport parport: parport_serial: Add Brainboxes device IDs and geometry 2024-01-20 11:50:11 +01:00
pci PCI: Add ACS quirk for more Zhaoxin Root Ports 2024-01-20 11:50:11 +01:00
pcmcia pcmcia: ds: fix possible name leak in error path in pcmcia_device_add() 2023-11-20 11:52:13 +01:00
peci
perf perf: hisi: Fix use-after-free when register pmu fails 2023-11-20 11:52:01 +01:00
phy phy: mapphone-mdm6600: Fix pinctrl_pm handling for sleep pins 2023-10-25 12:03:16 +02:00
pinctrl pinctrl: cy8c95x0: Fix get_pincfg 2024-01-20 11:50:09 +01:00
platform platform/x86/intel/vsec: Fix xa_alloc memory leak 2024-01-25 15:27:20 -08:00
pnp
power power: supply: core: Use blocking_notifier_call_chain to avoid RCU complaint 2023-11-08 14:11:02 +01:00
powercap powercap: DTPM: Fix missing cpufreq_cpu_put() calls 2023-12-13 18:39:21 +01:00
pps
ps3
ptp ptp: annotate data-race around q->head and q->tail 2023-11-28 17:07:05 +00:00
pwm pwm: brcmstb: Utilize appropriate clock APIs in suspend/resume 2023-11-20 11:52:15 +01:00
rapidio
ras
regulator regulator: mt6358: Fail probe on unknown chip ID 2023-11-20 11:51:56 +01:00
remoteproc
reset reset: hisilicon: hi6220: fix Wvoid-pointer-to-enum-cast warning 2024-01-20 11:50:07 +01:00
rpmsg rpmsg: glink: Add check for kstrdup 2023-09-13 09:42:58 +02:00
rtc rtc: pcf85363: fix wrong mask/val parameters in regmap_update_bits call 2023-11-20 11:52:13 +01:00
s390 s390/scm: fix virtual vs physical address confusion 2024-01-20 11:50:08 +01:00
sbus
scsi scsi: core: Always send batch on reset or error handling command 2024-01-01 12:39:07 +00:00
sh
siox
slimbus
soc pmdomain: imx: Make imx pgc power domain also set the fwnode 2023-11-28 17:07:16 +00:00
soundwire soundwire: stream: fix NULL pointer dereference for multi_link 2023-12-20 17:00:25 +01:00
spi spi: sh-msiof: Enforce fixed DTDL for R-Car H3 2024-01-25 15:27:20 -08:00
spmi
ssb
staging net: vlan: introduce skb_vlan_eth_hdr() 2023-12-20 17:00:16 +01:00
target scsi: target: core: Fix deadlock due to recursive locking 2023-10-10 22:00:41 +02:00
tc
tee tee: optee: Fix supplicant based device enumeration 2023-12-13 18:39:12 +01:00
thermal thermal: core: prevent potential string overflow 2023-11-20 11:51:54 +01:00
thunderbolt thunderbolt: Fix memory leak in margining_port_remove() 2024-01-01 12:39:08 +00:00
tty serial: 8250_omap: Add earlycon support for the AM654 UART controller 2023-12-13 18:39:28 +01:00
ufs scsi: ufs: core: Leave space for '\0' in utf8 desc string 2023-11-20 11:52:07 +01:00
uio uio: Fix use-after-free in uio_open 2024-01-20 11:50:10 +01:00
usb usb: fotg210-hcd: delete an incorrect bounds test 2024-01-05 15:18:37 +01:00
vdpa vdpa/mlx5: preserve CVQ vringh index 2023-12-13 18:39:03 +01:00
vfio vfio/mdev: Fix a null-ptr-deref bug for mdev_unregister_parent() 2023-10-06 14:56:45 +02:00
vhost vhost-vdpa: fix use after free in vhost_vdpa_probe() 2023-11-28 17:07:04 +00:00
video fbdev: imsttfb: fix double free in probe() 2024-01-10 17:10:29 +01:00
virt virt: sevguest: Fix passing a stack buffer as a scatterlist target 2023-11-20 11:52:13 +01:00
virtio virtio_pci: fix the common cfg map size 2023-11-02 09:35:23 +01:00
vlynq
w1
watchdog sbsa_gwdt: Calculate timeout with 64-bit math 2023-11-28 17:07:18 +00:00
xen xen: simplify evtchn_do_upcall() call maze 2023-12-08 08:51:20 +01:00
zorro
Kconfig
Makefile