summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2025-08-18net: mvpp2: Cannot test unsigned variable to be negativeAndrew Goodbody
In phy_info_parse all uses of the variable phyaddr are as an int so declaring as u32 is not useful and prevents the test for an error return from fdtdec_get_int ever detecting an error. Change phyaddr to be an int. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]>
2025-08-18net: mvpp2: Return -ENOMEM for failed allocAndrew Goodbody
Instead of returning -1 on a failed alloc, return -ENOMEM. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]>
2025-08-18net: mvpp2: Fix impossible testAndrew Goodbody
You cannot test an unsigned char to be >= 256. Instead make the variables start and end to be ints. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]>
2025-08-18net: mv88e6xxx: Fix logical operator instead of bitwiseAndrew Goodbody
In mv88e6xxx_port_enable when attempting to mask out the previous settings of two bits a logical operator was used instead of a bitwise operator. Fix this. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]>
2025-08-18net: mediatek: Use correct variable for returnAndrew Goodbody
In mtk_eth_of_to_plat, the last error check has the value in 'priv->phy_addr' but returns ret. Correct to return 'priv->phy_addr' instead. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]>
2025-08-18net: ldpaa_eth: Fix buffer overflow in memsetAndrew Goodbody
In ldpaa_eth_open a memset is used to initialise a struct to 0 but the size passed is that of a different struct. Correct to pass the sizeof the struct that is being initialised. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]>
2025-08-18net: phy: broadcom: add support for BCM54612EJim Liu
It's Broadcom PHY simply described as single-port RGMII 10/100/1000BASE-T PHY. Signed-off-by: Jim Liu <[email protected]>
2025-08-18net: designware: Fix get_timer value overflowJim Liu
get_timer returns a ulong value representing system time in ms. On a 64-bit system, this ulong value is 64 bits long. However, the driver stores it in a 32-bit unsigned integer, which overflows after 49 days up time, causing the driver to get an incorrect time. Replace the unsigned int variable with a ulong type to properly store the value returned by get_timer. Signed-off-by: Stanley Chu <[email protected]> Signed-off-by: Jim Liu <[email protected]>
2025-08-18phy: marvell: Cannot test unsigned field to be negativeAndrew Goodbody
In comphy_cp110_init_serdes_map in comphy_cp110.c there are two fields in cfg, comphy_lanes_count and comphy_mux_bitcount, which are fetched from the FDT blob with fdtdec_get_int which returns an int. These two fields are then tested for being negative. However the fields are declared as unsigned so those tests must always fail. Change the declaration of those fields to be int instead of u32 and the code will work as expected. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]> Reviewed-by: Stefan Roese <[email protected]>
2025-08-18phy: marvell: Fix off by 1 limit checksAndrew Goodbody
The limit checks in get_speed_string and get_type_string are off by 1 as they do not account for the maximum index into an array that can be used is 1 less than the number of elements in that array. Adjust the limit checks to allow for this. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]> Reviewed-by: Stefan Roese <[email protected]>
2025-08-18net: phy: vitesse: Fix incorrect test for timeoutAndrew Goodbody
In vsc8514_config there is a while loop for detecting a config failure using a timeout counter with a post-decrement. In the case of a timeout this will result in the loop exiting with timeout == -1 so use that as the test below the loop to detect that the timeout occurred. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]> Reviewed-by: Quentin Schulz <[email protected]>
2025-08-18net: octeontx: Free allocated memory on errorAndrew Goodbody
In octeontx_smi_probe if an error is detected then memory that was allocated is not freed. Small refactor of the code to use a common return and free memory. Also return -ENOMEM for an allocation failure. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]>
2025-08-18net: octeontx: Remove unneeded testAndrew Goodbody
In nicvf_cq_handler there is a test for !cqe_count which will return if true so it is guaranteed that cqe_count will true after that point. This makes the later test for cqe_count redundant so it can be removed. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]>
2025-08-18net: octeontx: Remove unneeded codeAndrew Goodbody
In nicvf_rcv_pkt_handler there is no need to initialise err as it is assigned to immediately after. Also the test for !pkt will return if true meaning that pkt is guaranteed to be true after that code block and so no need to test for it and the redundant test can be removed. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]>
2025-08-17pci: pcie-rcar-gen4: Fix PHY initializationMarek Vasut
R-Car V4H Reference Manual R19UH0186EJ0130 Rev.1.30 Apr. 21, 2025 page 4581 Figure 104.3b Initial Setting of PCIEC(example) middle of the figure indicates that fourth write into register 0x148 [2:0] is 0x3 or GENMASK(1, 0). The current code writes GENMASK(11, 0) which is a typo. Fix the typo. Fixes: be3dd0dc2fd9 ("pci: pcie-rcar-gen4: Add Renesas R-Car Gen4 DW PCIe controller driver") Signed-off-by: Marek Vasut <[email protected]>
2025-08-15pinctrl: stmfx: Remove duplicated codeAndrew Goodbody
In stmfx_read_reg there is duplicated code to detect ret < 0 and return ret if so. Remove one version of it. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]>
2025-08-15pinctrl: single: Remove unreachable codeAndrew Goodbody
In single_read there is a switch block with a default label. All cases in the switch block, including the default, return directly. So any code following the switch block is unreachable. Remove the unreachable code. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]>
2025-08-15ram: k3-ddrss: Use logical and not bitwiseAndrew Goodbody
The test for the interrupt LPDDR4_INTR_BIST_DONE is using a bitwise and but the test is simple logic so use the more appropriate logical and. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]>
2025-08-15phy: ti: j721e-wiz: Set error code before gotoAndrew Goodbody
In j721e_wiz_probe the test for too many lanes jumps to the error exit path without assigning an error code which could lead to calling code silently ignoring the failure. Set the error code. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]>
2025-08-15phy: keystone-usb: Do not negate return codeAndrew Goodbody
In keystone_usb_init the return code from psc_enable_module should be returned as is rather than being negated. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]>
2025-08-15timer: Tighten some timer driver dependenciesTom Rini
A few timer drivers cannot build without access to some platform specific header files. Express those requirements in Kconfig as well. Signed-off-by: Tom Rini <[email protected]>
2025-08-15timer: fttmr010_timer: Remove unused driverTom Rini
This driver is unused. Remove it. Signed-off-by: Tom Rini <[email protected]>
2025-08-15net: ti: icssg: Remove impossible testAndrew Goodbody
port_id is an unsigned variable so cannot be negative. Remove the test checking for port_id being less than 0. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]>
2025-08-15net: ti: am65-cpsw-nuss: Initialise retAndrew Goodbody
In am65_cpsw_phy_init it is not certain that ret will be assigned to before it reaches the 'return ret' statement. Initialise ret to ensure that ret is valid. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]>
2025-08-15net: phy: cortina: Ensure memory allocated is freedAndrew Goodbody
In cs4340_upload_firmware a buffer is allocated with malloc but this is never freed. The pointer to this buffer, addr, is not even kept unchanged. But in some cases addr is not a buffer allocated by malloc. Introduce the use of another pointer to keep track of the buffer and to know if it needs to be freed. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]>
2025-08-14ram: Tighten some ram driver dependenciesTom Rini
A few ram drivers cannot build without access to some platform specific header files. Express those requirements in Kconfig as well. Signed-off-by: Tom Rini <[email protected]>
2025-08-14serial: linflexuart: Remove unused driverTom Rini
This driver is unused. Remove it. Signed-off-by: Tom Rini <[email protected]>
2025-08-14serial: Tighten some serial driver dependenciesTom Rini
A few serial drivers cannot build without access to some platform specific header files. Express those requirements in Kconfig as well. Signed-off-by: Tom Rini <[email protected]>
2025-08-14rtc: pl031: Correct function type of pl031_write_regTom Rini
When calling writel we do not have a return value to check or pass along. This function should therefore be void and not return what writel gives us. Signed-off-by: Tom Rini <[email protected]>
2025-08-14rtc: mc146818: Fix building on more architecturesTom Rini
This driver makes calls to in8/out8(). On PowerPC these are separate and real calls but elsewhere they are able to simply be wrappers to inb/outb. Rework this logic to be able to build this driver on more platforms. Signed-off-by: Tom Rini <[email protected]>
2025-08-14rtc: Tighten some rtc driver dependenciesTom Rini
The Marvell RTC rtc driver cannot build without access to some platform specific header files. Express that requirements in Kconfig as well. Signed-off-by: Tom Rini <[email protected]>
2025-08-14sysreset: Tighten some sysreset driver dependenciesTom Rini
The MPC83xx sysreset driver cannot build without access to some architecture specific header files. Express that requirements in Kconfig as well. Reviewed-by: Peter Robinson <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2025-08-14sound: Tighten some sound driver dependenciesTom Rini
A few sound drivers cannot build without access to some platform specific header files. Express those requirements in Kconfig as well. Reviewed-by: Peter Robinson <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2025-08-14soc: Tighten some soc driver dependenciesTom Rini
The Qualcomm Snapdragon "SoC" driver cannot build without access to some ARM64 specific functionality. Express that requirements in Kconfig as well. Reviewed-by: Casey Connolly <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2025-08-14remoteproc: Tighten some remoteproc driver dependenciesTom Rini
The TI IPU remoteproc driver cannot build without access to some platform specific header files. Express that requirements in Kconfig as well. Signed-off-by: Tom Rini <[email protected]>
2025-08-14reset: Tighten some reset driver dependenciesTom Rini
A few reset drivers cannot build without access to some platform specific header files. Express those requirements in Kconfig as well. Signed-off-by: Tom Rini <[email protected]>
2025-08-14pwm: pwm-aspeed: Add missing <linux/log2.h> to pwm-aspeed.cTom Rini
This driver references the logarithmic macros while relying on an indirection inclusion of <linux/log2.h>. Add the missing include directly. Signed-off-by: Tom Rini <[email protected]>
2025-08-14pwm: Tighten some pwm driver dependenciesTom Rini
A few pwm drivers cannot build without access to some platform specific header files. Express those requirements in Kconfig as well. Signed-off-by: Tom Rini <[email protected]>
2025-08-14pinctrl: Tighten some pinctrl driver dependenciesTom Rini
A few pinctrl drivers cannot build without access to some platform specific header files. Express those requirements in Kconfig as well. Signed-off-by: Tom Rini <[email protected]>
2025-08-14sm: Rework the Kconfig logic hereTom Rini
The symbol "SM" is a library symbol and should not be prompted for. It should be selected by the drivers that use it. In this case we need to add a SANDBOX_SM symbol for the sandbox driver. The meson SM driver cannot build on other platforms, so add the appropriate dependency. Reviewed-by: Peter Robinson <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2025-08-14net: e1000: Free temporary buffer on exitAndrew Goodbody
In do_e1000_spi_checksum a temporary buffer is allocated but never freed. Add code to free on exit. Also refactor the code to make the exit code common. This issue found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]>
2025-08-14misc: add PolarFire SoC system controllerJamie Gibbons
This driver provides an interface to access the functions of the system controller on the Microchip PolarFire SoC. This driver includes functions to use the system controller to read the device serial number. Signed-off-by: Jamie Gibbons <[email protected]> Acked-by: Leo Yu-Chi Liang <[email protected]>
2025-08-14mailbox: add PolarFire SoC mailbox driverJamie Gibbons
This driver adds support for the single mailbox channel of the MSS system controller on the Microchip PolarFire SoC. Signed-off-by: Jamie Gibbons <[email protected]> Acked-by: Leo Yu-Chi Liang <[email protected]>
2025-08-13Merge tag 'qcom-fixes-13Aug2025' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-snapdragon CI: https://source.denx.de/u-boot/custodians/u-boot-snapdragon/-/pipelines/27364 Quite a few Smatch issues reported by Andrew, and the LMB allocation fix.
2025-08-13pinctrl: qcom: sdm845: Limit check off by 1Andrew Goodbody
The driver specifies 154 pins so should have a maximum selector of 153 to ensure that the index into the array special_pins_names does not overflow. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Casey Connolly <[email protected]>
2025-08-13pinctrl: qcom: sa8775: Limit check for array index not correctAndrew Goodbody
In sa8775p_get_pin_name the limit check for the index into msm_special_pins_data allows for more elements than exist. Add code to ensure the array index remains in bounds. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Casey Connolly <[email protected]>
2025-08-13button: qcom-pmic: Fix dereference of uninitialised pointerAndrew Goodbody
The pointer 'label' is declared and later dereferenced without ever having a value assigned to it. Add an assignment to this pointer so it will be valid later when dereferenced. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]> Reviewed-by: Casey Connolly <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Casey Connolly <[email protected]>
2025-08-13serial: msm-geni: No need to NULL check privAndrew Goodbody
The NULL check for priv in qcom_geni_serial_poll_bit serves no useful prupose as too much other code surrounding it relies on priv being valid. Remove the NULL check for priv and other related code. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Casey Connolly <[email protected]>
2025-08-13serial: msm-geni: Detect error from get_clk_div_rateAndrew Goodbody
In msm_serial_setbrg if the call to get_clk_div_rate fails then there will not have been an assignment to clk_div which will lead to the call to geni_serial_baud using an uninitialised value. Check for an error from get_clk_div_rate and return an error code if so. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]> Reviewed-by: Casey Connolly <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Casey Connolly <[email protected]>
2025-08-13phy: qcom: Fix ret is uninitialisedAndrew Goodbody
In qcom_snps_eusb2_phy_probe after the call to devm_clk_get if an error is found then ret is printed but has not been assigned to by the code. Decode the error from the pointer and assign it to ret. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]> Reviewed-by: Sumit Garg <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Casey Connolly <[email protected]>