mirror of
https://git.proxmox.com/git/mirror_ubuntu-kernels.git
synced 2025-12-18 21:36:15 +00:00
The Broadcom bnxt_ptp driver does not compile with GCC 11.2.2 when
CONFIG_WERROR is enabled. The following error is generated:
drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c: In function ‘bnxt_ptp_enable’:
drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c:400:43: error: array
subscript 255 is above array bounds of ‘struct pps_pin[4]’
[-Werror=array-bounds]
400 | ptp->pps_info.pins[pin_id].event = BNXT_PPS_EVENT_EXTERNAL;
| ~~~~~~~~~~~~~~~~~~^~~~~~~~
In file included from drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c:20:
drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h:75:24: note: while
referencing ‘pins’
75 | struct pps_pin pins[BNXT_MAX_TSIO_PINS];
| ^~~~
cc1: all warnings being treated as errors
This is due to the function ptp_find_pin() returning a pin ID of -1 when
a valid pin is not found and this error never being checked.
Change the TSIO_PIN_VALID() function to also check that a pin ID is not
negative and use this macro in bnxt_ptp_enable() to check the result of
the calls to ptp_find_pin() to return an error early for invalid pins.
This fixes the compilation error.
Cc: <stable@vger.kernel.org>
Fixes:
|
||
|---|---|---|
| .. | ||
| bnx2x | ||
| bnxt | ||
| genet | ||
| b44.c | ||
| b44.h | ||
| bcm63xx_enet.c | ||
| bcm63xx_enet.h | ||
| bcm4908_enet.c | ||
| bcm4908_enet.h | ||
| bcmsysport.c | ||
| bcmsysport.h | ||
| bgmac-bcma-mdio.c | ||
| bgmac-bcma.c | ||
| bgmac-platform.c | ||
| bgmac.c | ||
| bgmac.h | ||
| bnx2_fw.h | ||
| bnx2.c | ||
| bnx2.h | ||
| cnic_defs.h | ||
| cnic_if.h | ||
| cnic.c | ||
| cnic.h | ||
| Kconfig | ||
| Makefile | ||
| sb1250-mac.c | ||
| tg3.c | ||
| tg3.h | ||
| unimac.h | ||