Commit graph

1031559 commits

Author SHA1 Message Date
Dan Carpenter
626520f4ba staging: r8188eu: scheduling in atomic in rtw_createbss_cmd()
A couple of the callers are holding spinlocks so this allocation has to
be atomic.  One spinlock is in rtw_set_802_11_connect() but the simpler
spinlock to review is when this function is called from
rtw_surveydone_event_callback().

Fixes: 15865124fe ("staging: r8188eu: introduce new core dir for RTL8188eu driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20210812065852.GB31863@kili
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-12 10:28:29 +02:00
Dan Carpenter
0ea03f795d staging: r8188eu: Fix a couple scheduling in atomic bugs
These allocations are sometimes done while holding a spin_lock so they
have to be atomic.  The call tree looks like this:

-> rtw_set_802_11_connect() <- takes a spin_lock
   -> rtw_do_join()
      -> rtw_sitesurvey_cmd()  <-- does a GFP_ATOMIC allocation
         -> p2p_ps_wk_cmd()

Fixes: 15865124fe ("staging: r8188eu: introduce new core dir for RTL8188eu driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20210812065710.GA31863@kili
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-12 10:28:25 +02:00
Larry Finger
0d5e4bfe47 staging: r8188eu: Fix smatch warnings in os_dep/*.c
Smatch shows the following:

drivers/staging/r8188eu/os_dep/ioctl_linux.c:1478 rtw_wx_set_essid() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/ioctl_linux.c:1479 rtw_wx_set_essid() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/ioctl_linux.c:1481 rtw_wx_set_essid() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/ioctl_linux.c:1555 rtw_wx_set_rate() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/ioctl_linux.c:2596 rtw_wps_start() warn: variable dereferenced before check 'pdata' (see line 2590)
drivers/staging/r8188eu/os_dep/ioctl_linux.c:2790 rtw_p2p_profilefound() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/ioctl_linux.c:4846 rtw_set_encryption() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/ioctl_linux.c:5628 rtw_mp_efuse_get() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/ioctl_linux.c:7251 rtw_mp_set() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/ioctl_linux.c:7255 rtw_mp_set() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/ioctl_linux.c:7310 rtw_mp_get() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/ioctl_linux.c:7345 rtw_mp_get() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/ioctl_linux.c:7349 rtw_mp_get() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/mlme_linux.c:106 rtw_os_indicate_disconnect() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/os_intfs.c:1118 ips_netdrv_open() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/osdep_service.c:37 rtw_atoi() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/recv_linux.c:65 rtw_os_recvbuf_resource_free() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/usb_intf.c:338 rtw_hw_suspend() warn: variable dereferenced before check 'padapter' (see line 327)
drivers/staging/r8188eu/os_dep/usb_intf.c:381 rtw_hw_suspend() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/usb_intf.c:394 rtw_hw_resume() warn: variable dereferenced before check 'padapter' (see line 391)
drivers/staging/r8188eu/os_dep/usb_intf.c:506 rtw_resume() warn: inconsistent indenting

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20210812015232.23784-4-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-12 10:28:01 +02:00
Larry Finger
178cd80dc1 staging: r8188eu: Fix smatch problems in hal/*.c
Smatch detects the folloring:

drivers/staging/r8188eu/hal/HalHWImg8188E_RF.c:199 ODM_ReadAndConfig_RadioA_1T_8188E() warn: inconsistent indenting
drivers/staging/r8188eu/hal/HalPwrSeqCmd.c:65 HalPwrSeqCmdParsing() warn: inconsistent indenting
drivers/staging/r8188eu/hal/odm.c:225 ODM_DMWatchdog() warn: inconsistent indenting
drivers/staging/r8188eu/hal/odm.c:485 ODM_Write_DIG() warn: inconsistent indenting
drivers/staging/r8188eu/hal/odm.c:485 ODM_Write_DIG() warn: if statement not indented
drivers/staging/r8188eu/hal/odm.c:491 ODM_Write_DIG() warn: if statement not indented
drivers/staging/r8188eu/hal/odm.c:493 ODM_Write_DIG() warn: inconsistent indenting
drivers/staging/r8188eu/hal/odm.c:496 ODM_Write_DIG() warn: if statement not indented
drivers/staging/r8188eu/hal/odm.c:498 ODM_Write_DIG() warn: inconsistent indenting
drivers/staging/r8188eu/hal/odm.c:501 ODM_Write_DIG() warn: if statement not indented
drivers/staging/r8188eu/hal/odm.c:551 odm_DIGbyRSSI_LPS() warn: inconsistent indenting
drivers/staging/r8188eu/hal/Hal8188ERateAdaptive.c:360 odm_ARFBRefresh_8188E() warn: inconsistent indenting
drivers/staging/r8188eu/hal/odm_HWConfig.c:268 odm_RxPhyStatus92CSeries_Parsing() warn: inconsistent indenting
drivers/staging/r8188eu/hal/rtl8188e_hal_init.c:726 hal_EfusePowerSwitch_RTL8188E() warn: inconsistent indenting
drivers/staging/r8188eu/hal/rtl8188e_mp.c:60 Hal_mpt_SwitchRfSetting() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/ioctl_linux.c:547 wpa_set_encryption() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/ioctl_linux.c:1478 rtw_wx_set_essid() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/ioctl_linux.c:1479 rtw_wx_set_essid() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/ioctl_linux.c:1481 rtw_wx_set_essid() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/ioctl_linux.c:1555 rtw_wx_set_rate() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/ioctl_linux.c:2596 rtw_wps_start() warn: variable dereferenced before check 'pdata' (see line 2590)
drivers/staging/r8188eu/os_dep/ioctl_linux.c:2790 rtw_p2p_profilefound() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/ioctl_linux.c:4846 rtw_set_encryption() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/ioctl_linux.c:5628 rtw_mp_efuse_get() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/ioctl_linux.c:7055 rtw_mp_thermal() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/ioctl_linux.c:7251 rtw_mp_set() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/ioctl_linux.c:7255 rtw_mp_set() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/ioctl_linux.c:7310 rtw_mp_get() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/ioctl_linux.c:7345 rtw_mp_get() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/ioctl_linux.c:7349 rtw_mp_get() warn: inconsistent indenting
drivers/staging/r8188eu/hal/usb_halinit.c:856 rtl8188eu_hal_init() warn: inconsistent indenting
drivers/staging/r8188eu/hal/usb_halinit.c:859 rtl8188eu_hal_init() warn: inconsistent indenting
drivers/staging/r8188eu/hal/usb_halinit.c:862 rtl8188eu_hal_init() warn: inconsistent indenting
drivers/staging/r8188eu/hal/usb_halinit.c:887 rtl8188eu_hal_init() warn: inconsistent indenting
drivers/staging/r8188eu/hal/usb_halinit.c:915 rtl8188eu_hal_init() warn: inconsistent indenting
drivers/staging/r8188eu/hal/usb_halinit.c:925 rtl8188eu_hal_init() warn: inconsistent indenting
drivers/staging/r8188eu/hal/usb_halinit.c:929 rtl8188eu_hal_init() warn: inconsistent indenting
drivers/staging/r8188eu/hal/usb_ops_linux.c:263 usb_writeN() warn: inconsistent indenting
drivers/staging/r8188eu/hal/usb_ops_linux.c:568 usb_read_port() warn: inconsistent indenting
`

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
drivers/staging/r8188eu/hal/usb_halinit.c:1887:17: warning: mixing declarations and code
drivers/staging/r8188eu/hal/usb_ops_linux.c:519:25: error: typename in expression
Link: https://lore.kernel.org/r/20210812015232.23784-3-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-12 10:28:01 +02:00
Larry Finger
4d50f76395 staging: r8188eu: Fix Smatch warnings for core/*.c
Smatch reports the following problems:
drivers/staging/r8188eu/core/rtw_br_ext.c:655 nat25_db_handle() warn: if statement not indented
drivers/staging/r8188eu/core/rtw_cmd.c:436 rtw_sitesurvey_cmd() warn: if statement not indented
drivers/staging/r8188eu/core/rtw_cmd.c:450 rtw_sitesurvey_cmd() warn: if statement not indented
drivers/staging/r8188eu/core/rtw_led.c:330 SwLedBlink2() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_led.c:359 SwLedBlink2() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_led.c:538 SwLedBlink4() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_led.c:567 SwLedBlink4() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_led.c:685 SwLedBlink5() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_led.c:771 SwLedControlMode1() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_led.c:819 SwLedControlMode1() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_led.c:845 SwLedControlMode1() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_led.c:1574 LedControl8188eu() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_mlme.c:420 is_same_network() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_mlme.c:986 rtw_joinbss_update_stainfo() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_mlme.c:1162 rtw_joinbss_event_prehandle() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_mlme.c:1858 rtw_restruct_sec_ie() error: uninitialized symbol 'authmode'.
drivers/staging/r8188eu/core/rtw_mlme.c:1869 rtw_restruct_sec_ie() error: uninitialized symbol 'authmode'.
drivers/staging/r8188eu/core/rtw_mlme_ext.c:401 _mgt_dispatcher() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_mlme_ext.c:3210 is_matched_in_profilelist() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_mlme_ext.c:4351 dump_mgntframe_and_wait() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_mlme_ext.c:4374 dump_mgntframe_and_wait_ack() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_mlme_ext.c:7378 _linked_rx_signal_strehgth_display() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_mp.c:694 SetPacketTx() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_mp.c:900 _rtw_mp_xmit_priv() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_p2p.c:1130 process_p2p_group_negotation_req() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_recv.c:188 rtw_free_recvframe() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_recv.c:499 portctrl() error: uninitialized symbol 'ether_type'.
drivers/staging/r8188eu/core/rtw_recv.c:507 portctrl() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_recv.c:722 sta2sta_data_frame() warn: if statement not indented
drivers/staging/r8188eu/core/rtw_recv.c:1601 amsdu_to_msdu() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_security.c:283 rtw_seccalctkipmic() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_security.c:1116 aes_cipher() warn: for statement not indented
drivers/staging/r8188eu/core/rtw_security.c:1213 rtw_aes_encrypt() warn: inconsistent indenting
rivers/staging/r8188eu/core/rtw_sta_mgt.c:18 _rtw_init_stainfo() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_sta_mgt.c:475 rtw_get_bcmc_stainfo() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_wlan_util.c:65 cckratesonly_included() warn: if statement not indented
drivers/staging/r8188eu/core/rtw_wlan_util.c:1150 should_forbid_n_rate() warn: if statement not indented
drivers/staging/r8188eu/core/rtw_wlan_util.c:1401 check_assoc_AP() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_wlan_util.c:1403 check_assoc_AP() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_xmit.c:805 rtw_make_wlanhdr() warn: if statement not indented
drivers/staging/r8188eu/core/rtw_xmit.c:1691 rtw_br_client_tx() warn: inconsistent indenting
drivers/staging/r8188eu/hal/HalHWImg8188E_RF.c:199 ODM_ReadAndConfig_RadioA_1T_8188E() warn: inconsistent indenting

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20210812015232.23784-2-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-12 10:28:00 +02:00
Fabio M. De Francesco
221abd4d47 staging: r8188eu: Remove no more necessary definitions and code
Remove no more necessary further 5GHz related code, along with no
more used definitions of macro and variables.

Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210812002519.23678-4-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-12 10:25:47 +02:00
Fabio M. De Francesco
9f68048346 staging: r8188eu: Remove code related to unsupported channels
Remove all code related to unsupported channel
bandwidths. rtl8188eu* NICs work only on 20 and
40 Mhz channels.

Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210812002519.23678-3-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-12 10:25:47 +02:00
Fabio M. De Francesco
1fee0cc939 staging: r8188eu: Remove all 5GHz network types
Remove all 5Ghz network types. r8188eu works on
802.11bgn standards and on 2.4Ghz band.

Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210812002519.23678-2-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-12 10:25:47 +02:00
Martin Kaiser
e7dd1a58ce staging: r8188eu: remove CONFIG_USB_HCI from Makefile
We already depend on USB. There's no need to set CONFIG_USB_HCI in the
Makefile.

Some other Realtek drivers use #ifdef CONFIG_USB_HCI in their code, the
r8188 driver doesn't.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210811201450.31366-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-12 10:23:02 +02:00
Martin Kaiser
a1c95234d6 staging: r8188eu: use proper way to build a module
It seems that for now, we can only build this driver as a module.

Use the same mechanism as other drivers (such as rtl8723bs or the
deprecated rtl8188eu) to enforce building as a module, i.e. depend on m
in Kconfig instead of setting CONFIG_R8188EU = m in the Makefile.

If we set CONFIG_R8188EU in the Makefile, this setting will not be visible
in .config.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210811201450.31366-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-12 10:23:02 +02:00
Martin Kaiser
ef32cccc7f staging: r8188eu: (trivial) remove a duplicate debug print
Keep the one that shows the wakeup capability.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210811201450.31366-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-12 10:23:02 +02:00
Martin Kaiser
86d90d776e staging: r8188eu: remove unused function parameters
rtw_usb_if1_init and chip_by_usb_id do not need a
struct usb_device_id parameter.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210811201450.31366-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-12 10:23:02 +02:00
Martin Kaiser
b8a59fed6b staging: r8188eu: remove unused efuse hal components
struct hal_data_8188e contains some components related to efuses which
are not used for rl8188eu.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210811201450.31366-1-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-12 10:23:02 +02:00
Dee-Jay Anthony Logozzo
959aabedcd staging: gdm724x: Place macro argument within parentheses
Place the macro arguments within parentheses to avoid precedence issues.
This solves the following checkpatch.pl warnings

CHECK: Macro argument 'len' may be better as '(len)' to avoid precedence issues
+#define ND_NLMSG_S_LEN(len)    (len + ND_IFINDEX_LEN)

CHECK: Macro argument 'nlh' may be better as '(nlh)' to avoid precedence issues
+#define ND_NLMSG_R_LEN(nlh)    (nlh->nlmsg_len - ND_IFINDEX_LEN)

Signed-off-by: Dee-Jay Anthony Logozzo <dj@djl.id.au>
Link: https://lore.kernel.org/r/20210811134132.5240-1-dj@djl.id.au
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-12 10:21:50 +02:00
Linus Torvalds
1746f4db51 orphans fix for v5.14-rc6
- Handle changes to Clang's Sanitizer section layout (Nathan Chancellor)
 -----BEGIN PGP SIGNATURE-----
 
 iQJKBAABCgA0FiEEpcP2jyKd1g9yPm4TiXL039xtwCYFAmEUJpoWHGtlZXNjb29r
 QGNocm9taXVtLm9yZwAKCRCJcvTf3G3AJiffD/9j4v5DapiODxxutLLVhZ8pf+8H
 vRmg3D/nCflZgbCyy322sZkuIiSnL1/SKGgf65gHldnRskLF6PCqTeNiB60mBOQK
 8b+IemNodZJy2WB+RwEl8xXU7PKzB1ckldEstiPYTnFx+umdEcKXtkpKHmev7xVE
 aZwJn27FBrycZQNkIymXcR4Tw9PmvRJZcSDmiSRDl7lWunQRBhBRNwa1R2jOLecs
 0y40xqs8SuVmnW5WyVIo+hcgIf++An+NoCUXt6u/Z0BJkvZsmAsTf+ZYjIGHYWIE
 YJrqteDILzTot3BoZuU/3/OyJfuRGDkGZ8IUo/ZyNjCUa3fNDDQ3AmRa6uAtAdq0
 rEO0i+PGAAkwLtzz4LYtYhWaHjNu9nC1EVrVkmBlEWYVXs26PLGMizcw6rMTnLT6
 4Mwdimjr500HM90Xl1YiBbTfiv3YWhTUCGajgz+QWPBtfIirJV8g9/7zZq5YHqb2
 KIuYGxoUl6hstVRYl9QaBWP9tE3C6eMr07KWKjpOByephwzZJ7IAoiDLy98i4d0B
 +1TlBUsm5edzO/FaqeIv4LPPtaQ08toRsEwMczTavHsJhZKQ4kb4ruTs6lTAhVL/
 /OPmO155YSvxTEBNLUi6M6Oc8HlNvj8jVKJu3HTGW6nygS6tzco+y9wA9m7WX+us
 KSHOOByHfc8tyFjejg==
 =v6rY
 -----END PGP SIGNATURE-----

Merge tag 'orphans-v5.14-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux

Pull orphan section linker fix from Kees Cook:

 - Handle changes to Clang's Sanitizer section layout (Nathan
   Chancellor)

* tag 'orphans-v5.14-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
  vmlinux.lds.h: Handle clang's module.{c,d}tor sections
2021-08-11 20:00:55 -10:00
Linus Torvalds
fd66ad69ef seccomp fixes for v5.14-rc6
- Fix typo in user notification documentation (Rodrigo Campos)
 
 - Fix userspace counter report when using TSYNC (Hsuan-Chi Kuo, Wiktor Garbacz)
 -----BEGIN PGP SIGNATURE-----
 
 iQJKBAABCgA0FiEEpcP2jyKd1g9yPm4TiXL039xtwCYFAmEUHhAWHGtlZXNjb29r
 QGNocm9taXVtLm9yZwAKCRCJcvTf3G3AJvHdEACn+Ws1PhWQrypmFOG177DXC/jn
 Z/cBUxAE8F/y+lQ4wRkbN0GEQsrIFgDkTFPykzKfrgChud6cUhRe9gwmpKfpKNkZ
 ciD8jFfV/DP8tT1OtVMy2fPUWTQI/Lc5m9rvHYxYrRA1YbP6QF3RQouDzQw//VgB
 fLkdBs9izQKDreclPy5spumuy2Th07EIJyHHxw9pOW27QdtQgqHobkpXNXZWCGra
 4Uo6lvK9XSnbY0PI95uu+5UgHMmqaZ0S+gDZL+mP105kMj10cbjocJkdUm0Trov6
 06/J36gCFCVWlbDl6QOlJcUCUz2r5eeWTpW1qNrOTyd9CZzKVgNxDvx0jVP962Vg
 DfHxXzrg4EmhthQr3hphBwf0+was3g3s+bxkKn0mV3Vp9RJ6zzModt1+OsRB2zR3
 FqKyGJbujHqYUhi1i9KayQxazWk7dEccvfDjY9F2eGmFBuUlM5jr4Gt4k2Wl93Df
 Yoco1f4AaEV3uU6zUf+Ta40FjLtQO66/ZhmmozGvrWLH8Y02se4ICgS+lXoGs4/k
 R2IMG6OPCpjmJc39+R5Lyh1jtbOXHf4Brxb2MMZkpoXQCMEND9uOleTaVlOLd4sP
 HGyu7dI36d6xH40vSIBRGV4ypE7jQUIQkIopjDqzbtFAyFvBXr3zEr/s3EVyc1E0
 e+/PligHRRYBpl+l0w==
 =N5TG
 -----END PGP SIGNATURE-----

Merge tag 'seccomp-v5.14-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux

Pull seccomp fixes from Kees Cook:

 - Fix typo in user notification documentation (Rodrigo Campos)

 - Fix userspace counter report when using TSYNC (Hsuan-Chi Kuo, Wiktor
   Garbacz)

* tag 'seccomp-v5.14-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
  seccomp: Fix setting loaded filter count during TSYNC
  Documentation: seccomp: Fix typo in user notification
2021-08-11 19:56:10 -10:00
Dave Airlie
bf71bde473 Merge tag 'amd-drm-fixes-5.14-2021-08-11' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes
amd-drm-fixes-5.14-2021-08-11:

amdgpu:
- Yellow carp update
- RAS EEPROM fixes
- BACO/BOCO fixes
- Fix a memory leak in an error path
- Freesync fix
- VCN harvesting fix
- Display fixes

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210812022153.4005-1-alexander.deucher@amd.com
2021-08-12 13:38:13 +10:00
Eric Dumazet
b69dd5b378 net: igmp: increase size of mr_ifc_count
Some arches support cmpxchg() on 4-byte and 8-byte only.
Increase mr_ifc_count width to 32bit to fix this problem.

Fixes: 4a2b285e7e ("net: igmp: fix data-race in igmp_ifc_timer_expire()")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20210811195715.3684218-1-eric.dumazet@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-08-11 15:54:10 -07:00
Sergey Shtylyov
0271824d9e MAINTAINERS: switch to my OMP email for Renesas Ethernet drivers
I'm still going to continue looking after the Renesas Ethernet drivers and
device tree bindings. Now my new employer, Open Mobile Platform (OMP), will
pay for all my upstream work. Let's switch to my OMP email for the reviews.

Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Link: https://lore.kernel.org/r/9c212711-a0d7-39cd-7840-ff7abf938da1@omp.ru
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-08-11 15:01:24 -07:00
Neal Cardwell
6de035fec0 tcp_bbr: fix u32 wrap bug in round logic if bbr_init() called after 2B packets
Currently if BBR congestion control is initialized after more than 2B
packets have been delivered, depending on the phase of the
tp->delivered counter the tracking of BBR round trips can get stuck.

The bug arises because if tp->delivered is between 2^31 and 2^32 at
the time the BBR congestion control module is initialized, then the
initialization of bbr->next_rtt_delivered to 0 will cause the logic to
believe that the end of the round trip is still billions of packets in
the future. More specifically, the following check will fail
repeatedly:

  !before(rs->prior_delivered, bbr->next_rtt_delivered)

and thus the connection will take up to 2B packets delivered before
that check will pass and the connection will set:

  bbr->round_start = 1;

This could cause many mechanisms in BBR to fail to trigger, for
example bbr_check_full_bw_reached() would likely never exit STARTUP.

This bug is 5 years old and has not been observed, and as a practical
matter this would likely rarely trigger, since it would require
transferring at least 2B packets, or likely more than 3 terabytes of
data, before switching congestion control algorithms to BBR.

This patch is a stable candidate for kernels as far back as v4.9,
when tcp_bbr.c was added.

Fixes: 0f8782ea14 ("tcp_bbr: add BBR congestion control")
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Reviewed-by: Yuchung Cheng <ycheng@google.com>
Reviewed-by: Kevin Yang <yyd@google.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20210811024056.235161-1-ncardwell@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-08-11 15:00:15 -07:00
Wong Vee Khee
2cad5d2ed1 net: pcs: xpcs: fix error handling on failed to allocate memory
Drivers such as sja1105 and stmmac that call xpcs_create() expects an
error returned by the pcs-xpcs module, but this was not the case on
failed to allocate memory.

Fixed this by returning an -ENOMEM instead of a NULL pointer.

Fixes: 3ad1d17154 ("net: dsa: sja1105: migrate to xpcs for SGMII")
Signed-off-by: Wong Vee Khee <vee.khee.wong@linux.intel.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://lore.kernel.org/r/20210810085812.1808466-1-vee.khee.wong@linux.intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-08-11 14:50:54 -07:00
Willy Tarreau
6922110d15 net: linkwatch: fix failure to restore device state across suspend/resume
After migrating my laptop from 4.19-LTS to 5.4-LTS a while ago I noticed
that my Ethernet port to which a bond and a VLAN interface are attached
appeared to remain up after resuming from suspend with the cable unplugged
(and that problem still persists with 5.10-LTS).

It happens that the following happens:

  - the network driver (e1000e here) prepares to suspend, calls e1000e_down()
    which calls netif_carrier_off() to signal that the link is going down.
  - netif_carrier_off() adds a link_watch event to the list of events for
    this device
  - the device is completely stopped.
  - the machine suspends
  - the cable is unplugged and the machine brought to another location
  - the machine is resumed
  - the queued linkwatch events are processed for the device
  - the device doesn't yet have the __LINK_STATE_PRESENT bit and its events
    are silently dropped
  - the device is resumed with its link down
  - the upper VLAN and bond interfaces are never notified that the link had
    been turned down and remain up
  - the only way to provoke a change is to physically connect the machine
    to a port and possibly unplug it.

The state after resume looks like this:
  $ ip -br li | egrep 'bond|eth'
  bond0            UP             e8:6a:64:64:64:64 <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP>
  eth0             DOWN           e8:6a:64:64:64:64 <NO-CARRIER,BROADCAST,MULTICAST,SLAVE,UP>
  eth0.2@eth0      UP             e8:6a:64:64:64:64 <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP>

Placing an explicit call to netdev_state_change() either in the suspend
or the resume code in the NIC driver worked around this but the solution
is not satisfying.

The issue in fact really is in link_watch that loses events while it
ought not to. It happens that the test for the device being present was
added by commit 124eee3f69 ("net: linkwatch: add check for netdevice
being present to linkwatch_do_dev") in 4.20 to avoid an access to
devices that are not present.

Instead of dropping events, this patch proceeds slightly differently by
postponing their handling so that they happen after the device is fully
resumed.

Fixes: 124eee3f69 ("net: linkwatch: add check for netdevice being present to linkwatch_do_dev")
Link: https://lists.openwall.net/netdev/2018/03/15/62
Cc: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Link: https://lore.kernel.org/r/20210809160628.22623-1-w@1wt.eu
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-08-11 14:43:16 -07:00
Tejun Heo
0f78399551 Revert "block/mq-deadline: Add cgroup support"
This reverts commit 08a9ad8bf6 ("block/mq-deadline: Add cgroup support")
and a follow-up commit c06bc5a3fb ("block/mq-deadline: Remove a
WARN_ON_ONCE() call"). The added cgroup support has the following issues:

* It breaks cgroup interface file format rule by adding custom elements to a
  nested key-value file.

* It registers mq-deadline as a cgroup-aware policy even though all it's
  doing is collecting per-cgroup stats. Even if we need these stats, this
  isn't the right way to add them.

* It hasn't been reviewed from cgroup side.

Cc: Bart Van Assche <bvanassche@acm.org>
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-08-11 13:47:26 -06:00
Nathan Chancellor
848378812e vmlinux.lds.h: Handle clang's module.{c,d}tor sections
A recent change in LLVM causes module_{c,d}tor sections to appear when
CONFIG_K{A,C}SAN are enabled, which results in orphan section warnings
because these are not handled anywhere:

ld.lld: warning: arch/x86/pci/built-in.a(legacy.o):(.text.asan.module_ctor) is being placed in '.text.asan.module_ctor'
ld.lld: warning: arch/x86/pci/built-in.a(legacy.o):(.text.asan.module_dtor) is being placed in '.text.asan.module_dtor'
ld.lld: warning: arch/x86/pci/built-in.a(legacy.o):(.text.tsan.module_ctor) is being placed in '.text.tsan.module_ctor'

Fangrui explains: "the function asan.module_ctor has the SHF_GNU_RETAIN
flag, so it is in a separate section even with -fno-function-sections
(default)".

Place them in the TEXT_TEXT section so that these technologies continue
to work with the newer compiler versions. All of the KASAN and KCSAN
KUnit tests continue to pass after this change.

Cc: stable@vger.kernel.org
Link: https://github.com/ClangBuiltLinux/linux/issues/1432
Link: 7b78956224
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Fangrui Song <maskray@google.com>
Acked-by: Marco Elver <elver@google.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20210731023107.1932981-1-nathan@kernel.org
2021-08-11 12:19:58 -07:00
Dan Williams
96dcb97d0a Merge branch 'for-5.14/dax' into libnvdimm-fixes
Pick up some small dax cleanups that make some of Ira's follow on work
easier.
2021-08-11 12:04:43 -07:00
Dan Williams
f21453b0ff tools/testing/nvdimm: Fix missing 'fallthrough' warning
Use "fallthrough;" to address:

tools/testing/nvdimm/test/nfit.c: In function ‘nd_intel_test_finish_query’:
tools/testing/nvdimm/test/nfit.c:436:37: warning: this statement may
	fall through [-Wimplicit-fallthrough=]
  436 |                 fw->missed_activate = false;
      |                 ~~~~~~~~~~~~~~~~~~~~^~~~~~~
tools/testing/nvdimm/test/nfit.c:438:9: note: here
  438 |         case FW_STATE_UPDATED:
      |         ^~~~

Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Link: https://lore.kernel.org/r/162767522046.3313209.14767278726893995797.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2021-08-11 11:55:54 -07:00
Dan Williams
d9cee9f85b libnvdimm/region: Fix label activation vs errors
There are a few scenarios where init_active_labels() can return without
registering deactivate_labels() to run when the region is disabled. In
particular label error injection creates scenarios where a DIMM is
disabled, but labels on other DIMMs in the region become activated.

Arrange for init_active_labels() to always register deactivate_labels().

Reported-by: Krzysztof Kensicki <krzysztof.kensicki@intel.com>
Cc: <stable@vger.kernel.org>
Fixes: bf9bccc14c ("libnvdimm: pmem label sets and namespace instantiation.")
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Link: https://lore.kernel.org/r/162766356450.3223041.1183118139023841447.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2021-08-11 11:54:43 -07:00
Dan Williams
b93dfa6bda ACPI: NFIT: Fix support for virtual SPA ranges
Fix the NFIT parsing code to treat a 0 index in a SPA Range Structure as
a special case and not match Region Mapping Structures that use 0 to
indicate that they are not mapped. Without this fix some platform BIOS
descriptions of "virtual disk" ranges do not result in the pmem driver
attaching to the range.

Details:
In addition to typical persistent memory ranges, the ACPI NFIT may also
convey "virtual" ranges. These ranges are indicated by a UUID in the SPA
Range Structure of UUID_VOLATILE_VIRTUAL_DISK, UUID_VOLATILE_VIRTUAL_CD,
UUID_PERSISTENT_VIRTUAL_DISK, or UUID_PERSISTENT_VIRTUAL_CD. The
critical difference between virtual ranges and UUID_PERSISTENT_MEMORY,
is that virtual do not support associations with Region Mapping
Structures.  For this reason the "index" value of virtual SPA Range
Structures is allowed to be 0. If a platform BIOS decides to represent
NVDIMMs with disconnected "Region Mapping Structures" (range-index ==
0), the kernel may falsely associate them with standalone ranges where
the "SPA Range Structure Index" is also zero. When this happens the
driver may falsely require labels where "virtual disks" are expected to
be label-less. I.e. "label-less" is where the namespace-range ==
region-range and the pmem driver attaches with no user action to create
a namespace.

Cc: Jacek Zloch <jacek.zloch@intel.com>
Cc: Lukasz Sobieraj <lukasz.sobieraj@intel.com>
Cc: "Lee, Chun-Yi" <jlee@suse.com>
Cc: <stable@vger.kernel.org>
Fixes: c2f32acdf8 ("acpi, nfit: treat virtual ramdisk SPA as pmem region")
Reported-by: Krzysztof Rusocki <krzysztof.rusocki@intel.com>
Reported-by: Damian Bassa <damian.bassa@intel.com>
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Link: https://lore.kernel.org/r/162870796589.2521182.1240403310175570220.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2021-08-11 11:54:33 -07:00
Hsuan-Chi Kuo
b4d8a58f8d seccomp: Fix setting loaded filter count during TSYNC
The desired behavior is to set the caller's filter count to thread's.
This value is reported via /proc, so this fixes the inaccurate count
exposed to userspace; it is not used for reference counting, etc.

Signed-off-by: Hsuan-Chi Kuo <hsuanchikuo@gmail.com>
Link: https://lore.kernel.org/r/20210304233708.420597-1-hsuanchikuo@gmail.com
Co-developed-by: Wiktor Garbacz <wiktorg@google.com>
Signed-off-by: Wiktor Garbacz <wiktorg@google.com>
Link: https://lore.kernel.org/lkml/20210810125158.329849-1-wiktorg@google.com
Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: stable@vger.kernel.org
Fixes: c818c03b66 ("seccomp: Report number of loaded filters in /proc/$pid/status")
2021-08-11 11:48:28 -07:00
Linus Walleij
86e5fbcaf7 intel-pinctrl for v5.14-2
* Fix the software mapping of GPIOs on Intel Tiger Lake-H
 
 The following is an automated git shortlog grouped by driver:
 
 tigerlake:
  -  Fix GPIO mapping for newer version of software
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEqaflIX74DDDzMJJtb7wzTHR8rCgFAmEM/J0ACgkQb7wzTHR8
 rCgJwBAAiianaFjpoLfvDcGw+CHFVYwe7qn8M6Qm3F3pxcEKr14X36p9wW6ABNYz
 GFry+gxSCX3ULAfMDDq6lFAwja/1jWSXWHtiJIM2Pf3dCI0CSFWhb2NWN66cxeEe
 trof9O99zY4oLu3Q1csLqqlqBcembV6zp06J5aV+XE1L6s4BX9a72TqobT1zNq+U
 MydbsXVZE+NEz9u9Yu/OKKjzcBCvliedt6NKiJrBK4JWH2a0Vjxfz7edefZLuQJO
 uclGGBfgbF8u+Awmzs2iUTvRY6XZ9GJSxtM3a9qWQJQUi+tDiNhXbr+LsEHERRXO
 AD0a4bAXWkkeBje7YoThx7SKgFFZaZKpTKttUMNZFAfLIoPI9PuWqKz2xhiAcD1X
 cb7lSddtKlOBXrR6xi8iMwa9coZuXL6zTlaGUWl8x3Uy1yOwn17MM6Me+b35FCH8
 v36ds3G8VlKJKmt9h7nJr9OD7/zv7kHCPvIgLoEOF28yjw03Ch5SUDPYpAnQtltt
 N1X9n3mEA9YB7OxVPhJP/3GzAiUHghnWY8EZnNzIGOiF/El+mgn9P4xuHgt46nSC
 waqK60za5BsqEVcr0S1ZT4W1F7qCZkIqx+MQ8yrF4Mt5liESJPaOofkimsuMElTD
 PAn8mbhn3hFZ2siYYrx+DEyralz9Y61hm2EUtjHwV+NrQtv0lyg=
 =xU7N
 -----END PGP SIGNATURE-----

Merge tag 'intel-pinctrl-v5.14-2' of gitolite.kernel.org:pub/scm/linux/kernel/git/pinctrl/intel into fixes

intel-pinctrl for v5.14-2

* Fix the software mapping of GPIOs on Intel Tiger Lake-H

The following is an automated git shortlog grouped by driver:

tigerlake:
 -  Fix GPIO mapping for newer version of software
2021-08-11 15:10:32 +02:00
Damien Le Moal
31697ef7f3 pinctrl: k210: Fix k210_fpioa_probe()
In k210_fpioa_probe(), add missing calls to clk_disable_unprepare() in
case of error after cenabling the clk and pclk clocks. Also add missing
error handling when enabling pclk.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: d4c34d09ab ("pinctrl: Add RISC-V Canaan Kendryte K210 FPIOA driver")
Cc: <stable@vger.kernel.org>
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Link: https://lore.kernel.org/r/20210806004311.52859-1-damien.lemoal@wdc.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2021-08-11 15:03:53 +02:00
Tuo Li
25ee7e89d4 staging: rtl8192e: rtl_core: Fix possible null-pointer dereference in _rtl92e_pci_disconnect()
The variable dev is checked in:
  if (dev)

This indicates that it can be NULL. If so, a null-pointer dereference will
occur:
  priv = rtllib_priv(dev);

However, the value of priv is not used in the remaining part of this
function. Thus the else-branch can be removed to fix this posible
null-pointer dereference.

Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Tuo Li <islituo@gmail.com>
Link: https://lore.kernel.org/r/20210811031135.4110-1-islituo@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-11 09:43:44 +02:00
Nathan Chancellor
3a330ece23 staging: r8188eu: os_dep: Hoist vmalloc.h include into osdep_service.h
After commit 71f09c5ae9 ("staging: r8188eu: Remove wrapper around
vfree"), the driver fails to build on Hexagon due to an implicit
declaration in several different files:

drivers/staging/r8188eu/core/rtw_mlme.c:129:3: error: implicit
declaration of function 'vfree'
[-Werror,-Wimplicit-function-declaration]
                vfree(pmlmepriv->free_bss_buf);
                ^
1 error generated.

Previously, vfree() was only called in osdep_service.c, which includes
vmalloc.h for vmalloc() and vfree(). Now, the driver relies on vfree()
getting implicitly included from another file.

Hoist the vmalloc.h include from osdep_service.c to osdep_service.h so
that the driver continues to build fine on all architectures.

Fixes: 71f09c5ae9 ("staging: r8188eu: Remove wrapper around vfree")
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20210811005505.3953122-1-nathan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-11 09:42:32 +02:00
Yang Yingliang
e3027f25c6 staging: r8188eu: Use GFP_ATOMIC under spin lock
A spin lock is taken in __nat25_db_network_insert() and
update_BCNTIM() is called under spin lock so we should
use GFP_ATOMIC in both place.

Fixes: 15865124fe ("staging: r8188eu: introduce new core dir for RTL8188eu driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20210810125314.2182112-1-yangyingliang@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-11 09:42:08 +02:00
Larry Finger
dcda94c941 staging: r8188eu: Replace BITn with BIT(n)
The driver uses BITn instead of BIT(n). All such usage is converted.

Note that this patch does not address any warnings that checkpatch
will find. These include missing space around operators and lines
that are too long. These problems will be addressed in a separate
patch.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20210810180511.8986-1-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-11 09:41:38 +02:00
Phillip Potter
987219ad34 staging: r8188eu: remove lines from Makefile that silence build warnings
Remove the several lines from the Makefile that append EXTRA_CFLAGS options
to silence build warnings about unused variables, unused functions and such
like. This will enable cleanup of missed warnings, and easier spotting
of future such problems.

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210810235047.177883-9-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-11 09:41:04 +02:00
Phillip Potter
6be20b17ff staging: r8188eu: remove unused variable from rtw_init_recv_timer
Remove unused variable from rtw_init_recv_timer function in
os_dep/recv_linux.c

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210810235047.177883-8-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-11 09:41:04 +02:00
Phillip Potter
8268010e8f staging: r8188eu: remove unused variable from rtw_init_drv_sw
Remove unused variable from rtw_init_drv_sw function in
os_dep/os_intfs.c

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210810235047.177883-7-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-11 09:41:04 +02:00
Phillip Potter
fdd46ffbe4 staging: r8188eu: remove unused variable from rtl8188e_init_dm_priv
Remove unused variable from the rtl8188e_init_dm_priv function in
hal/rtl8188e_dm.c

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210810235047.177883-6-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-11 09:41:04 +02:00
Phillip Potter
aab8704730 staging: r8188eu: remove rtw_mfree_sta_priv_lock function
Remove rtw_mfree_sta_priv_lock function from rtw_sta_mgt.c, as it does
nothing and contains an unused variable.

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210810235047.177883-5-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-11 09:41:04 +02:00
Phillip Potter
d60489b697 staging: r8188eu: remove unused label from recv_indicatepkt_reorder
Remove unused goto label from recv_indicatepkt_reorder function in
core/rtw_recv.c

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210810235047.177883-4-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-11 09:41:03 +02:00
Phillip Potter
085f11874b staging: r8188eu: remove unused oid_null_function function
Remove unused oid_null_function function from include/rtw_ioctl.h

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210810235047.177883-3-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-11 09:41:03 +02:00
Phillip Potter
ba4b1d7cdd staging: r8188eu: remove unused functions from os_dep/ioctl_linux.c
Remove unused functions that are now no longer called as a result of the
removal of rtw_ioctl in a previous patch. This includes functions not
directly called from rtw_ioctl, but anything in that specific
call-chain.

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210810235047.177883-2-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-11 09:41:03 +02:00
Dave Airlie
1648740b2e Mediatek DRM Fixes for Linux 5.14
1. Fix dpi bridge bug.
 2. Fix cursor plane no update.
 -----BEGIN PGP SIGNATURE-----
 
 iQJMBAABCgA2FiEEACwLKSDmq+9RDv5P4cpzo8lZTiQFAmERQgYYHGNodW5rdWFu
 Zy5odUBrZXJuZWwub3JnAAoJEOHKc6PJWU4kG2oP/0vJx2DZfsmVW7liKViigg0f
 FA6XuWY0JLTApPqoWGfyJG7pF8yY8ICXCVqDQSCJ98kpUGuRDRb6KhG3xGt5q8+R
 CQHRnaBY9/te/rwvbQQXVH7hmFoiyELQmsc+elKViiESGv/cbfIhm2OfIXdlSVQj
 pis9XHqWlGFLXLMd8UOKkY0iIchkXM6p7FTS3aYRCJiz1B8yGkEBdwgyGzM+o/lB
 NZonAs1VP5HmIYCntfWp9zcGg/KwHyNXFRGN7eODGJRLF0htazx6hOERgcwwwtFe
 Zg5sCND75f+du0tBpXqjqaR6zBcbtmJVIL6Kj5daHrMnljNNV918rgkObVmmTKsz
 d/NOPIB9IMgUPinde9r1CsrFsmknp4W2WVl80246PqGqBdytxre1s4p4HKRrCf8i
 aoVAM/zmrFg9Cqgfjvu1eO6NrDhnNj78MFHZiNWyuuMwkO6lPxRK5wLHuZOYvQQR
 ZaTrKVPKDsqlfZDRH8wKpLsfIfyRdxlrFkRS2vR4guAvbpY83iLIbCyqWktO2AaG
 8ht1v/S5Dlyc+glrvsintEcBto32O3VrD1JcsT0oZIVe+Tqpw1qC8d+Frxs/sjYf
 vXRJ3QLGxEPdhQ2KewMchQbuHT/4icgz9+raYbfWyAgGLKPYSrn6dsVuTscXABSk
 AvevRcrKlZVEAlNuGJSj
 =7CUC
 -----END PGP SIGNATURE-----

Merge tag 'mediatek-drm-fixes-5.14' of https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux into drm-fixes

Mediatek DRM Fixes for Linux 5.14

1. Fix dpi bridge bug.
2. Fix cursor plane no update.

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20210809150604.32426-1-chunkuang.hu@kernel.org
2021-08-11 14:11:51 +10:00
Linus Torvalds
761c6d7ec8 ARC updates for 5.14-rc6
- Fix FPU_STATUS update
 
  - Update my email address
 
  - Other spellos and fixes
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEOXpuCuR6hedrdLCJadfx3eKKwl4FAmESzGwACgkQadfx3eKK
 wl5XGg/+N1CsI8fo0UVzAB8QmQPMLbtlUSRaHby+l9KEYeTJ3q1bEUaYHOmDUvSw
 jXMiMH5kyt7MYq1a/xV8tBuxZWBes2MvTq38N7XDbglmvR1Cg5jVuPnVpcH834jX
 bI7duvGbHbIVlxBGUOpY9Q9hY9I+dqIDt5lWd03Bg/LU3HnslUiOo5T1wz+I6S5H
 5NrpwJQDjWUvTSqVABcWGIODNzHcCvFroDtXxh018LxRDDE34UcWGUZbED73t7sH
 DwUjKA+c2YaU1nK1Eql4W/PwqkaqlZ1xvBFNN9B73rTDh0Zg4a8wOkiiA7TAzHJR
 5HuKK/bEikdDr6Kk2GBPxKEBqkcJlnPhGR/3O5qDxRJQ0thN5bCWi9kpBuNjr+Hm
 Zb0QjF0+J7o2H353vd5IoP5gOFstibCIIP5GNpkw7eQXdtaxtN8G7UZ0gGOupaWw
 UItfsUYqzwO/UDS21TS2B2Ap13vTk+JCxxclGnpHNY6w3QW2XzZu5wMobdwjtHfP
 MGTVv65yyW0OiPzNsqOfsjsKpRk/UR7fcp8PMq7WWDR+7Y6r1BFZisNez1J94EO4
 73LzfQAAFwWgTS9e+ylMhZ0RKS59kkbu6zkCjoNyGwhG+omKcw8xQK8OYthkbAel
 x6PEyY8jp6GZ4I+AJ4pkFQInj0rGhUhWljtfmvJZWlYXnqn/HZ4=
 =gS01
 -----END PGP SIGNATURE-----

Merge tag 'arc-5.14-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc

Pull ARC fixes from Vineet Gupta:

 - Fix FPU_STATUS update

 - Update my email address

 - Other spellos and fixes

* tag 'arc-5.14-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc:
  MAINTAINERS: update Vineet's email address
  ARC: fp: set FPU_STATUS.FWE to enable FPU_STATUS update on context switch
  ARC: Fix CONFIG_STACKDEPOT
  arc: Fix spelling mistake and grammar in Kconfig
  arc: Prefer unsigned int to bare use of unsigned
2021-08-10 16:34:34 -10:00
Hu Haowen
3f12cc4bb0 Documentation: i2c: add i2c-sysfs into index
Append i2c-sysfs to toctree in order to get rid of building warnings.

Fixes: 31df7195b1 ("Documentation: i2c: Add doc for I2C sysfs")
Signed-off-by: Hu Haowen <src.res@email.cn>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
2021-08-10 22:58:32 +02:00
Greg Kroah-Hartman
86ff25ed6c i2c: dev: zero out array used for i2c reads from userspace
If an i2c driver happens to not provide the full amount of data that a
user asks for, it is possible that some uninitialized data could be sent
to userspace.  While all in-kernel drivers look to be safe, just be sure
by initializing the buffer to zero before it is passed to the i2c driver
so that any future drivers will not have this issue.

Also properly copy the amount of data recvieved to the userspace buffer,
as pointed out by Dan Carpenter.

Reported-by: Eric Dumazet <edumazet@google.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
2021-08-10 22:54:10 +02:00
Dhananjay Phadke
bba676cc0b i2c: iproc: fix race between client unreg and tasklet
Similar NULL deref was originally fixed by graceful teardown sequence -

https://lore.kernel.org/linux-i2c/1597106560-79693-1-git-send-email-dphadke@linux.microsoft.com

After this, a tasklet was added to take care of FIFO full condition for large i2c
transaction.

https://lore.kernel.org/linux-arm-kernel/20201102035433.6774-1-rayagonda.kokatanur@broadcom.com/

This introduced regression, a new race condition between tasklet enabling
interrupts and client unreg teardown sequence.

Kill tasklet before unreg_slave() masks bits in IE_OFFSET.
Updated teardown sequence -
(1) disable_irq()
(2) Kill tasklet
(3) Mask event enable bits in control reg
(4) Erase slave address (avoid further writes to rx fifo)
(5) Flush tx and rx FIFOs
(6) Clear pending event (interrupt) bits in status reg
(7) Set client pointer to NULL
(8) enable_irq()

 --

 Unable to handle kernel read from unreadable memory at virtual address 0000000000000320
 Mem abort info:
   ESR = 0x96000004
   EC = 0x25: DABT (current EL), IL = 32 bits
   SET = 0, FnV = 0
   EA = 0, S1PTW = 0
 Data abort info:
   ISV = 0, ISS = 0x00000004
   CM = 0, WnR = 0
 user pgtable: 4k pages, 48-bit VAs, pgdp=000000009212a000
 [0000000000000320] pgd=0000000000000000, p4d=0000000000000000
 Internal error: Oops: 96000004 [#1] SMP
 CPU: 0 PID: 0 Comm: swapper/0 Tainted: G           O
 Hardware name: Overlake (DT)
 pstate: 40400085 (nZcv daIf +PAN -UAO -TCO BTYPE=--)
 pc : bcm_iproc_i2c_slave_isr+0x2b8/0x8e4
 lr : bcm_iproc_i2c_slave_isr+0x1c8/0x8e4
 sp : ffff800010003e70
 x29: ffff800010003e80 x28: ffffda017acdc000
 x27: ffffda017b0ae000 x26: ffff800010004000
 x25: ffff800010000000 x24: ffffda017af4a168
 x23: 0000000000000073 x22: 0000000000000000
 x21: 0000000001400000 x20: 0000000001000000
 x19: ffff06f09583f880 x18: 00000000fa83b2da
 x17: 000000000000b67e x16: 0000000002edb2f3
 x15: 00000000000002c7 x14: 00000000000002c7
 x13: 0000000000000006 x12: 0000000000000033
 x11: 0000000000000000 x10: 0000000001000000
 x9 : 0000000003289312 x8 : 0000000003289311
 x7 : 02d0cd03a303adbc x6 : 02d18e7f0a4dfc6c
 x5 : 02edb2f33f76ea68 x4 : 00000000fa83b2da
 x3 : ffffda017af43cd0 x2 : ffff800010003e74
 x1 : 0000000001400000 x0 : 0000000000000000
 Call trace:
  bcm_iproc_i2c_slave_isr+0x2b8/0x8e4
  bcm_iproc_i2c_isr+0x178/0x290
  __handle_irq_event_percpu+0xd0/0x200
  handle_irq_event+0x60/0x1a0
  handle_fasteoi_irq+0x130/0x220
  __handle_domain_irq+0x8c/0xcc
  gic_handle_irq+0xc0/0x120
  el1_irq+0xcc/0x180
  finish_task_switch+0x100/0x1d8
  __schedule+0x61c/0x7a0
  schedule_idle+0x28/0x44
  do_idle+0x254/0x28c
  cpu_startup_entry+0x28/0x2c
  rest_init+0xc4/0xd0
  arch_call_rest_init+0x14/0x1c
  start_kernel+0x33c/0x3b8
 Code: f9423260 910013e2 11000509 b9047a69 (f9419009)
 ---[ end trace 4781455b2a7bec15 ]---

Fixes: 4d658451c9 ("i2c: iproc: handle rx fifo full interrupt")

Signed-off-by: Dhananjay Phadke <dphadke@linux.microsoft.com>
Acked-by: Ray Jui <ray.jui@broadcom.com>
Acked-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
2021-08-10 22:40:55 +02:00
Yang Yingliang
519133debc net: bridge: fix memleak in br_add_if()
I got a memleak report:

BUG: memory leak
unreferenced object 0x607ee521a658 (size 240):
comm "syz-executor.0", pid 955, jiffies 4294780569 (age 16.449s)
hex dump (first 32 bytes, cpu 1):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<00000000d830ea5a>] br_multicast_add_port+0x1c2/0x300 net/bridge/br_multicast.c:1693
[<00000000274d9a71>] new_nbp net/bridge/br_if.c:435 [inline]
[<00000000274d9a71>] br_add_if+0x670/0x1740 net/bridge/br_if.c:611
[<0000000012ce888e>] do_set_master net/core/rtnetlink.c:2513 [inline]
[<0000000012ce888e>] do_set_master+0x1aa/0x210 net/core/rtnetlink.c:2487
[<0000000099d1cafc>] __rtnl_newlink+0x1095/0x13e0 net/core/rtnetlink.c:3457
[<00000000a01facc0>] rtnl_newlink+0x64/0xa0 net/core/rtnetlink.c:3488
[<00000000acc9186c>] rtnetlink_rcv_msg+0x369/0xa10 net/core/rtnetlink.c:5550
[<00000000d4aabb9c>] netlink_rcv_skb+0x134/0x3d0 net/netlink/af_netlink.c:2504
[<00000000bc2e12a3>] netlink_unicast_kernel net/netlink/af_netlink.c:1314 [inline]
[<00000000bc2e12a3>] netlink_unicast+0x4a0/0x6a0 net/netlink/af_netlink.c:1340
[<00000000e4dc2d0e>] netlink_sendmsg+0x789/0xc70 net/netlink/af_netlink.c:1929
[<000000000d22c8b3>] sock_sendmsg_nosec net/socket.c:654 [inline]
[<000000000d22c8b3>] sock_sendmsg+0x139/0x170 net/socket.c:674
[<00000000e281417a>] ____sys_sendmsg+0x658/0x7d0 net/socket.c:2350
[<00000000237aa2ab>] ___sys_sendmsg+0xf8/0x170 net/socket.c:2404
[<000000004f2dc381>] __sys_sendmsg+0xd3/0x190 net/socket.c:2433
[<0000000005feca6c>] do_syscall_64+0x37/0x90 arch/x86/entry/common.c:47
[<000000007304477d>] entry_SYSCALL_64_after_hwframe+0x44/0xae

On error path of br_add_if(), p->mcast_stats allocated in
new_nbp() need be freed, or it will be leaked.

Fixes: 1080ab95e3 ("net: bridge: add support for IGMP/MLD stats and export them via netlink")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Acked-by: Nikolay Aleksandrov <nikolay@nvidia.com>
Link: https://lore.kernel.org/r/20210809132023.978546-1-yangyingliang@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-08-10 13:25:14 -07:00
Vladimir Oltean
c35b57ceff net: switchdev: zero-initialize struct switchdev_notifier_fdb_info emitted by drivers towards the bridge
The blamed commit added a new field to struct switchdev_notifier_fdb_info,
but did not make sure that all call paths set it to something valid.
For example, a switchdev driver may emit a SWITCHDEV_FDB_ADD_TO_BRIDGE
notifier, and since the 'is_local' flag is not set, it contains junk
from the stack, so the bridge might interpret those notifications as
being for local FDB entries when that was not intended.

To avoid that now and in the future, zero-initialize all
switchdev_notifier_fdb_info structures created by drivers such that all
newly added fields to not need to touch drivers again.

Fixes: 2c4eca3ef7 ("net: bridge: switchdev: include local flag in FDB notifications")
Reported-by: Ido Schimmel <idosch@idosch.org>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Tested-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Reviewed-by: Karsten Graul <kgraul@linux.ibm.com>
Link: https://lore.kernel.org/r/20210810115024.1629983-1-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-08-10 13:22:57 -07:00