linux/drivers
Nathan Chancellor 533ccdae76 rtlwifi: rtl8192de: Fix initialization of place in _rtl92c_phy_get_rightchnlplace()
Clang warns:

drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c:901:6: warning:
variable 'place' is used uninitialized whenever 'if' condition is false
[-Wsometimes-uninitialized]
        if (chnl > 14) {
            ^~~~~~~~~
drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c:909:9: note:
uninitialized use occurs here
        return place;
               ^~~~~
drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c:901:2: note: remove
the 'if' if its condition is always true
        if (chnl > 14) {
        ^~~~~~~~~~~~~~~
drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c:899:10: note:
initialize the variable 'place' to silence this warning
        u8 place;
                ^
                 = '\0'
1 warning generated.

Commit 369956ae57 ("rtlwifi: rtl8192de: Remove redundant variable
initializations") removed the initialization of place but it appears
that this removal was in the wrong function.

_rtl92c_phy_get_rightchnlplace() returns place's value at the end of the
function so now if the if statement is false, place never gets
initialized. Add that initialization back to address the warning.

place's initialization is not necessary in
rtl92d_get_rightchnlplace_for_iqk() as place is only used within the if
statement so it can be removed, which is likely what was intended in the
first place.

Fixes: 369956ae57 ("rtlwifi: rtl8192de: Remove redundant variable initializations")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210823222014.764557-1-nathan@kernel.org
2021-08-29 10:28:32 +03:00
..
accessibility
acpi libnvdimm fixes for v5.14-rc6 2021-08-14 19:46:39 -10:00
amba
android
ata libata-5.14-2021-07-30 2021-07-30 10:56:47 -07:00
atm atm: horizon: Fix spelling mistakes in TX comment 2021-08-08 12:58:42 +01:00
auxdisplay
base PCI/MSI: Protect msi_desc::masked for multi-MSI 2021-08-10 10:59:20 +02:00
bcma
block virtio,vhost,vdpa: bugfixes 2021-08-16 06:16:25 -10:00
bluetooth Bluetooth: btusb: Remove WAKEUP_DISABLE and add WAKEUP_AUTOSUSPEND for Realtek devices 2021-08-19 17:08:31 +02:00
bus Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-08-13 06:41:22 -07:00
cdrom
char Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-08-13 06:41:22 -07:00
clk A collection of clk driver fixes and one core clk API fix 2021-08-03 09:26:09 -07:00
clocksource
comedi
connector
counter
cpufreq
cpuidle cpuidle: teo: Rename two local variables in teo_select() 2021-08-03 15:18:57 +02:00
crypto
cxl
dax Merge branch 'for-5.14/dax' into libnvdimm-fixes 2021-08-11 12:04:43 -07:00
dca
devfreq
dio
dma dmaengine fixes for v5.14 2021-08-06 11:08:24 -07:00
dma-buf
edac
eisa
extcon
firewire
firmware Ard says: 2021-08-15 06:38:26 -10:00
fpga fpga: dfl: fme: Fix cpu hotplug issue in performance reporting 2021-07-27 11:05:16 -07:00
fsi
gnss
gpio gpio: tqmx86: really make IRQ optional 2021-08-02 17:17:27 +02:00
gpu Short summary of fixes pull: 2021-08-13 06:37:40 +10:00
greybus
hid HID: ft260: fix device removal due to USB disconnect 2021-07-29 12:38:32 +02:00
hsi
hv Drivers: hv: vmbus: Fix duplicate CPU assignments within a device 2021-07-19 09:26:31 +00:00
hwmon
hwspinlock
hwtracing
i2c i2c: dev: zero out array used for i2c reads from userspace 2021-08-10 22:54:10 +02:00
i3c
idle
iio iio: adc: Fix incorrect exit of for-loop 2021-07-31 14:46:05 +01:00
infiniband ethtool: extend coalesce setting uAPI with CQE mode 2021-08-24 07:38:29 -07:00
input
interconnect interconnect: Fix undersized devress_alloc allocation 2021-08-02 12:25:00 +03:00
iommu
ipack
irqchip
isdn
leds
lightnvm
macintosh
mailbox
mcb
md block-5.14-2021-08-07 2021-08-07 10:26:21 -07:00
media media fixes for v5.14-rc5 2021-08-03 09:33:05 -07:00
memory
memstick
message
mfd
misc Merge tag 'at24-fixes-for-v5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into i2c/for-current 2021-07-20 22:28:56 +02:00
mmc MMC core: 2021-07-22 09:51:38 -07:00
most
mtd MTD core fixes: 2021-08-16 06:36:01 -10:00
mux
net rtlwifi: rtl8192de: Fix initialization of place in _rtl92c_phy_get_rightchnlplace() 2021-08-29 10:28:32 +03:00
nfc nfc: virtual_ncidev: Use wait queue instead of polling 2021-08-18 10:17:57 +01:00
ntb
nubus
nvdimm libnvdimm/region: Fix label activation vs errors 2021-08-11 11:54:43 -07:00
nvme block-5.14-2021-07-24 2021-07-24 12:57:06 -07:00
nvmem
of
opp
parisc
parport
pci PCI: Add pcie_ptm_enabled() 2021-08-24 11:36:13 -07:00
pcmcia pcmcia: i82092: fix a null pointer dereference bug 2021-07-23 08:08:54 +02:00
perf
phy
pinctrl pinctrl: amd: Fix an issue with shutdown when system set to s0ix 2021-08-12 11:16:40 +02:00
platform platform/x86: gigabyte-wmi: add support for B450M S2H V2 2021-08-18 19:39:31 +02:00
pnp
power
powercap
pps
ps3
ptp Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-08-19 18:09:18 -07:00
pwm
rapidio
ras
regulator regulator: Fixes for v5.14 2021-07-21 12:37:49 -07:00
remoteproc
reset
rpmsg
rtc
s390 ethtool: extend coalesce setting uAPI with CQE mode 2021-08-24 07:38:29 -07:00
sbus
scsi Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-08-19 18:09:18 -07:00
sh
siox
slimbus
soc soc: ixp4xx/qmgr: fix invalid __iomem access 2021-08-03 10:16:34 +02:00
soundwire
spi spi: Fixes for v5.14 2021-08-06 11:15:02 -07:00
spmi
ssb
staging ethtool: extend coalesce setting uAPI with CQE mode 2021-08-24 07:38:29 -07:00
target scsi: target: Fix NULL dereference on XCOPY completion 2021-07-20 23:18:22 -04:00
tc
tee tee: Correct inappropriate usage of TEE_SHM_DMA_BUF flag 2021-07-21 07:55:50 +02:00
thermal
thunderbolt Revert "thunderbolt: Hide authorized attribute if router does not support PCIe tunnels" 2021-07-27 18:14:25 +02:00
tty Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-08-13 06:41:22 -07:00
uio
usb Revert "usb: dwc3: gadget: Use list_replace_init() before traversing lists" 2021-08-10 09:12:32 +02:00
vdpa Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-08-19 18:09:18 -07:00
vfio
vhost vringh: Use wiov->used to check for read/write desc order 2021-08-11 06:44:24 -04:00
video drm fixes for 5.14-rc2 2021-07-16 11:14:54 -07:00
virt virt: acrn: Do hcall_destroy_vm() before resource release 2021-07-27 16:48:45 +02:00
virtio virtio_ring: pull in spinlock header 2021-08-11 06:44:24 -04:00
visorbus
vlynq
vme
w1
watchdog
xen xen: branch for v5.14-rc6 2021-08-14 06:31:22 -10:00
zorro
Kconfig
Makefile