summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-12-28staging: r8188eu: remove the private ioctl "tdls"Martin Kaiser
Remove the private ioctl "tdls", it is mapped to an empty function. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211226212535.197989-9-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-28staging: r8188eu: remove the private ioctl "tdls_get"Martin Kaiser
Remove the private ioctl "tdls_get", it is mapped to an empty function. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211226212535.197989-8-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-28staging: r8188eu: remove the private ioctl "wps_assoc_req_ie"Martin Kaiser
Remove the private ioctl "wps_assoc_req_ie", it is mapped to an empty function. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211226212535.197989-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-28staging: r8188eu: remove private ioctls that return -1Martin Kaiser
Remove the private ioctls that are mapped to rtw_wx_priv_null. rtw_wx_priv_null itself can also be removed. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211226212535.197989-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-28staging: r8188eu: remove the private ioctl "wps_prob_req_ie"Martin Kaiser
Remove the private ioctl "wps_prob_req_ie", it is mapped to an empty function. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211226212535.197989-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-28staging: r8188eu: remove the private drvext_hdl ioctlMartin Kaiser
Remove the private drvext_hdl ioctl, it is mapped to an empty function. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211226212535.197989-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-28staging: r8188eu: remove the private ioctl "get sensitivity"Martin Kaiser
Remove the private ioctl "get sensitivity", it is mapped to an empty function. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211226212535.197989-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-28staging: r8188eu: remove unused rtw_private_args entriesMartin Kaiser
Remove the entries of the rtw_private_args array that refer to non-existing private ioctls. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211226212535.197989-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-28staging: r8188eu: rfoff_reason is never initialisedMartin Kaiser
rfoff_reason in struct pwrctrl_priv is never set, its value remains 0. Remove rfoff_reason, related defines and a check in rtw_led_control that is always false. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211226195556.159471-22-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-28staging: r8188eu: merge rtw_led_control and SwLedControlMode1Martin Kaiser
rtw_led_control is the only caller of SwLedControlMode1. Pull SwLedControlMode1 into rtw_led_control. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211226195556.159471-21-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-28staging: r8188eu: merge blink_work and SwLedBlink1Martin Kaiser
blink_work is the only caller of SwLedBlink1. Merge the two functions. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211226195556.159471-20-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-28staging: r8188eu: summarize some BlinkingLedStateMartin Kaiser
Move BlinkingLedState updates out of if clauses where the same update is done for all possible paths. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211226195556.159471-19-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-28staging: r8188eu: remove bStopBlinkingMartin Kaiser
Remove the temporary variable bStopBlinking and check the conditions directly in the if clauses. There's no need to save the result of these checks. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211226195556.159471-18-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-28staging: r8188eu: LED_CTL_START_WPS_BOTTON is not usedMartin Kaiser
None of the callers sets LED_CTL_START_WPS_BOTTON. Remove the define and related dead code. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211226195556.159471-17-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-28staging: r8188eu: LED_CTL_POWER_ON is not usedMartin Kaiser
The LED_CTL_POWER_ON mode is not used by this driver. Remove the define and related dead code. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211226195556.159471-16-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-28staging: r8188eu: remove LedControlHandlerMartin Kaiser
Export the function that other layers use for setting the led. Remove the function pointer and the macro to make the led control function configurable. This driver supports only a single configuration. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211226195556.159471-15-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-28staging: r8188eu: remove obsolete commentsMartin Kaiser
Remove some comments that don't make sense any more. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211226195556.159471-14-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-28staging: r8188eu: use bool for boolean valuesMartin Kaiser
Change some boolean variables from u8 to bool. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211226195556.159471-13-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-28staging: r8188eu: make blink interval defines internalMartin Kaiser
The defines for led blink intervals are used only by the led layer. Move them into rtw_led.c. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211226195556.159471-12-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-28staging: r8188eu: bLedStartToLinkBlinkInProgress is set but not usedMartin Kaiser
Remove bLedStartToLinkBlinkInProgress from struct LED_871x. It's set but not used. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211226195556.159471-11-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-28staging: r8188eu: remove unused blink mode definesMartin Kaiser
Remove defines for led blink modes which are not used by this driver. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211226195556.159471-10-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-28staging: r8188eu: clean up blinking macrosMartin Kaiser
Clean up the macros that check the blinking mode of a LED. The macro IS_LED_BLINKING is not used and can be removed. The IS_LED_WPS_BLINKING macro is used only by rtw_led.c. Move the macro into this file. The macro parameter is always a struct LED_871x *, there's no need for a cast. Rename the parameter to l and put it in parentheses, which is good practice for macro parameters. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211226195556.159471-9-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-28staging: r8188eu: clean up the blink worker codeMartin Kaiser
Merge the BlinkWorkItemCallback and BlinkHandler functions. Rename the resulting function to blink_work and make it internal to the led layer. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211226195556.159471-8-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-28staging: r8188eu: make ResetLedStatus staticMartin Kaiser
The ResetLedStatus function is used only by the led layer. Make it static. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211226195556.159471-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-28staging: r8188eu: merge DeInitLed871x and rtl8188eu_DeInitSwLedsMartin Kaiser
Merge DeInitLed871x and rtl8188eu_DeInitSwLeds, both of which are small and simple. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211226195556.159471-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-28staging: r8188eu: merge InitLed871x and rtl8188eu_InitSwLedsMartin Kaiser
Copy InitLed871x into rtl8188eu_InitSwLeds. There's no need for two separate functions. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211226195556.159471-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-28staging: r8188eu: move (de)init functions from hal to rtw_ledMartin Kaiser
Move the led init and deinit functions from the hal layer to rtw_led.c. rtl8188eu_led.c and rtl8188e_led.h can now be removed. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211226195556.159471-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-28staging: r8188eu: move SwLedOn and SwLedOff into rtw_led.cMartin Kaiser
Move the low-level functions SwLedOn and SwLedOff from the hal layer into rtw_led.c. This is the only place where they're used. There's no need to go through the hal layer for a simple register access if the driver supports only a single chipset. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211226195556.159471-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-28staging: r8188eu: switch the led off during deinitMartin Kaiser
When the driver is unloaded or when the system goes into standby mode, DeInitLed871x is called to stop the led layer. In this case, we stop the blinking worker but we do not switch the led off explicitly. On my system, I can go into standby mode with the LED enabled. Add a call to SwLedOff to fix this. Fixes: 15865124feed ("staging: r8188eu: introduce new core dir for RTL8188eu driver") Cc: stable@vger.kernel.org Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211226195556.159471-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-28staging: vt6655: drop off byRxMode var in device.hTommaso Merciai
Drop off unused variable byRxMode in device.h Signed-off-by: Tommaso Merciai <tomm.merciai@gmail.com> Link: https://lore.kernel.org/r/20211225173500.5459-1-tomm.merciai@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-28staging: most: dim2: use consistent routine namingNikita Yushchenko
Rename init routines and enum values to reflect that those are for Renesas R-Car Gen2 and R-Car Gen3 SoCs. Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com> Link: https://lore.kernel.org/r/20211226082530.2245198-3-nikita.yoush@cogentembedded.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-28staging: most: dim2: update renesas compatible stringNikita Yushchenko
Use "renesas,rcar-gen3-mlp" instead of "rcar,medialb-dim2" - the documented vendor prefix for Renesas is "renesas," - existing r-car devices use "rcar-genN-XXX" pattern. There are currently no in-tree users to update. Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com> Link: https://lore.kernel.org/r/20211226082530.2245198-2-nikita.yoush@cogentembedded.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-28staging: r8188eu: include variable declarations from Hal8188EPwrSeq.hAbdun Nihaal
Variable declarations of rtl8188E_power_on_flow, rtl8188E_card_disable_flow and rtl8188E_enter_lps_flow are present in Hal8188EPwrSeq.h. A previous commit changed Hal8188EPwrSeq.c to include HalPwrSeqCmd.h directly instead of Hal8188EPwrSeq.h, causing these sparse warnings: - symbol 'rtl8188E_power_on_flow' was not declared. Should it be static? - symbol 'rtl8188E_card_disable_flow' was not declared.Should it be static? - symbol 'rtl8188E_enter_lps_flow' was not declared. Should it be static? This patch reverts the include line to include the declarations. Fixes: 4f458ec5f497 ("staging: r8188: move the steps into Hal8188EPwrSeq.c") Acked-by: Martin Kaiser <martin@kaiser.cx> Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com> Link: https://lore.kernel.org/r/20211224121043.175650-1-abdun.nihaal@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-28staging: rtl8723bs: removed unused if blocksIsmayil Mirzali
Deleted the commented if blocks that weren't being used as suggested by the maintainers. Signed-off-by: Ismayil Mirzali <ismayilmirzeli@gmail.com> Link: https://lore.kernel.org/r/b4652b7490f3574445d567ef662270605533bfa4.1640197297.git.ismayilmirzeli@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-28staging: pi433: remove unnecessary parentheses pointed out by checkpatch.plPaulo Miguel Almeida
Checkpatch reports 'Unnecessary parentheses around <lines>'. Fix this by removing extraneous parentheses where applicable. Signed-off-by: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com> Link: https://lore.kernel.org/r/20211222070256.GA7644@localhost.localdomain Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-28staging: vc04_services: Remove repeated word in vchiq log warningGautam Menghani
In a log warning in vhciq code, the word 'count' is repeated twice. Remove repeated word 'count' from vhciq log warning. This change has been suggested by checkpatch.pl Signed-off-by: Gautam Menghani <gautammenghani14@gmail.com> Link: https://lore.kernel.org/r/20211228101615.5073-1-gautammenghani14@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-28hwmon: (xgene-hwmon) Add free before exiting xgene_hwmon_probePeiwei Hu
Call kfifo_free(&ctx->async_msg_fifo) before error exiting instead of returning directly. Signed-off-by: Peiwei Hu <jlu.hpw@foxmail.com> Link: https://lore.kernel.org/r/tencent_C851C0324431466CBC22D60C5C6AC4A8E808@qq.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2021-12-28drm/amdgpu: no DC support for headless chipsAlex Deucher
Chips with no display hardware should return false for DC support. v2: drop Arcturus and Aldebaran Fixes: f7f12b25823c0d ("drm/amdgpu: default to true in amdgpu_device_asic_has_dc_support") Reviewed-by: Evan Quan <evan.quan@amd.com> Reviewed-by: Guchun Chen <guchun.chen@amd.com> Reported-by: Tareque Md.Hanif <tarequemd.hanif@yahoo.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2021-12-28net: caif: remove redundant assignment to variable expectlenColin Ian King
Variable expectlen is being assigned a value that is never read, the assignment occurs before a return statement. The assignment is redundant and can be removed. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-12-28Merge branch 'smc-fixes'David S. Miller
Dust Li says: ==================== net/smc: fix kernel panic caused by race of smc_sock This patchset fixes the race between smc_release triggered by close(2) and cdc_handle triggered by underlaying RDMA device. The race is caused because the smc_connection may been released before the pending tx CDC messages got its CQEs. In order to fix this, I add a counter to track how many pending WRs we have posted through the smc_connection, and only release the smc_connection after there is no pending WRs on the connection. The first patch prevents posting WR on a QP that is not in RTS state. This patch is needed because if we post WR on a QP that is not in RTS state, ib_post_send() may success but no CQE will return, and that will confuse the counter tracking the pending WRs. The second patch add a counter to track how many WRs were posted through the smc_connection, and don't reset the QP on link destroying to prevent leak of the counter. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2021-12-28net/smc: fix kernel panic caused by race of smc_sockDust Li
A crash occurs when smc_cdc_tx_handler() tries to access smc_sock but smc_release() has already freed it. [ 4570.695099] BUG: unable to handle page fault for address: 000000002eae9e88 [ 4570.696048] #PF: supervisor write access in kernel mode [ 4570.696728] #PF: error_code(0x0002) - not-present page [ 4570.697401] PGD 0 P4D 0 [ 4570.697716] Oops: 0002 [#1] PREEMPT SMP NOPTI [ 4570.698228] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.16.0-rc4+ #111 [ 4570.699013] Hardware name: Alibaba Cloud Alibaba Cloud ECS, BIOS 8c24b4c 04/0 [ 4570.699933] RIP: 0010:_raw_spin_lock+0x1a/0x30 <...> [ 4570.711446] Call Trace: [ 4570.711746] <IRQ> [ 4570.711992] smc_cdc_tx_handler+0x41/0xc0 [ 4570.712470] smc_wr_tx_tasklet_fn+0x213/0x560 [ 4570.712981] ? smc_cdc_tx_dismisser+0x10/0x10 [ 4570.713489] tasklet_action_common.isra.17+0x66/0x140 [ 4570.714083] __do_softirq+0x123/0x2f4 [ 4570.714521] irq_exit_rcu+0xc4/0xf0 [ 4570.714934] common_interrupt+0xba/0xe0 Though smc_cdc_tx_handler() checked the existence of smc connection, smc_release() may have already dismissed and released the smc socket before smc_cdc_tx_handler() further visits it. smc_cdc_tx_handler() |smc_release() if (!conn) | | |smc_cdc_tx_dismiss_slots() | smc_cdc_tx_dismisser() | |sock_put(&smc->sk) <- last sock_put, | smc_sock freed bh_lock_sock(&smc->sk) (panic) | To make sure we won't receive any CDC messages after we free the smc_sock, add a refcount on the smc_connection for inflight CDC message(posted to the QP but haven't received related CQE), and don't release the smc_connection until all the inflight CDC messages haven been done, for both success or failed ones. Using refcount on CDC messages brings another problem: when the link is going to be destroyed, smcr_link_clear() will reset the QP, which then remove all the pending CQEs related to the QP in the CQ. To make sure all the CQEs will always come back so the refcount on the smc_connection can always reach 0, smc_ib_modify_qp_reset() was replaced by smc_ib_modify_qp_error(). And remove the timeout in smc_wr_tx_wait_no_pending_sends() since we need to wait for all pending WQEs done, or we may encounter use-after- free when handling CQEs. For IB device removal routine, we need to wait for all the QPs on that device been destroyed before we can destroy CQs on the device, or the refcount on smc_connection won't reach 0 and smc_sock cannot be released. Fixes: 5f08318f617b ("smc: connection data control (CDC)") Reported-by: Wen Gu <guwen@linux.alibaba.com> Signed-off-by: Dust Li <dust.li@linux.alibaba.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-12-28net/smc: don't send CDC/LLC message if link not readyDust Li
We found smc_llc_send_link_delete_all() sometimes wait for 2s timeout when testing with RDMA link up/down. It is possible when a smc_link is in ACTIVATING state, the underlaying QP is still in RESET or RTR state, which cannot send any messages out. smc_llc_send_link_delete_all() use smc_link_usable() to checks whether the link is usable, if the QP is still in RESET or RTR state, but the smc_link is in ACTIVATING, this LLC message will always fail without any CQE entering the CQ, and we will always wait 2s before timeout. Since we cannot send any messages through the QP before the QP enter RTS. I add a wrapper smc_link_sendable() which checks the state of QP along with the link state. And replace smc_link_usable() with smc_link_sendable() in all LLC & CDC message sending routine. Fixes: 5f08318f617b ("smc: connection data control (CDC)") Signed-off-by: Dust Li <dust.li@linux.alibaba.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-12-28NFC: st21nfca: Fix memory leak in device probe and removeWei Yongjun
'phy->pending_skb' is alloced when device probe, but forgot to free in the error handling path and remove path, this cause memory leak as follows: unreferenced object 0xffff88800bc06800 (size 512): comm "8", pid 11775, jiffies 4295159829 (age 9.032s) hex dump (first 32 bytes): 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: [<00000000d66c09ce>] __kmalloc_node_track_caller+0x1ed/0x450 [<00000000c93382b3>] kmalloc_reserve+0x37/0xd0 [<000000005fea522c>] __alloc_skb+0x124/0x380 [<0000000019f29f9a>] st21nfca_hci_i2c_probe+0x170/0x8f2 Fix it by freeing 'pending_skb' in error and remove. Fixes: 68957303f44a ("NFC: ST21NFCA: Add driver for STMicroelectronics ST21NFCA NFC Chip") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-12-28net: lantiq_xrx200: fix statistics of received bytesAleksander Jan Bajkowski
Received frames have FCS truncated. There is no need to subtract FCS length from the statistics. Fixes: fe1a56420cf2 ("net: lantiq: Add Lantiq / Intel VRX200 Ethernet driver") Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-12-28net: ag71xx: Fix a potential double free in error handling pathsChristophe JAILLET
'ndev' is a managed resource allocated with devm_alloc_etherdev(), so there is no need to call free_netdev() explicitly or there will be a double free(). Simplify all error handling paths accordingly. Fixes: d51b6ce441d3 ("net: ethernet: add ag71xx driver") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-12-28mISDN: change function names to avoid conflictswolfgang huang
As we build for mips, we meet following error. l1_init error with multiple definition. Some architecture devices usually marked with l1, l2, lxx as the start-up phase. so we change the mISDN function names, align with Isdnl2_xxx. mips-linux-gnu-ld: drivers/isdn/mISDN/layer1.o: in function `l1_init': (.text+0x890): multiple definition of `l1_init'; \ arch/mips/kernel/bmips_5xxx_init.o:(.text+0xf0): first defined here make[1]: *** [home/mips/kernel-build/linux/Makefile:1161: vmlinux] Error 1 Signed-off-by: wolfgang huang <huangjinhui@kylinos.cn> Reported-by: k2ci <kernel-bot@kylinos.cn> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-12-28x86/mce/inject: Avoid out-of-bounds write when setting flagsZhang Zixun
A contrived zero-length write, for example, by using write(2): ... ret = write(fd, str, 0); ... to the "flags" file causes: BUG: KASAN: stack-out-of-bounds in flags_write Write of size 1 at addr ffff888019be7ddf by task writefile/3787 CPU: 4 PID: 3787 Comm: writefile Not tainted 5.16.0-rc7+ #12 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-2 04/01/2014 due to accessing buf one char before its start. Prevent such out-of-bounds access. [ bp: Productize into a proper patch. Link below is the next best thing because the original mail didn't get archived on lore. ] Fixes: 0451d14d0561 ("EDAC, mce_amd_inj: Modify flags attribute to use string arguments") Signed-off-by: Zhang Zixun <zhang133010@icloud.com> Signed-off-by: Borislav Petkov <bp@suse.de> Link: https://lore.kernel.org/linux-edac/YcnePfF1OOqoQwrX@zn.tnic/
2021-12-28kobject: remove kset from struct kset_uevent_ops callbacksGreg Kroah-Hartman
There is no need to pass the pointer to the kset in the struct kset_uevent_ops callbacks as no one uses it, so just remove that pointer entirely. Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Wedson Almeida Filho <wedsonaf@google.com> Link: https://lore.kernel.org/r/20211227163924.3970661-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-28thunderbolt: Add module parameter for CLx disablingGil Fine
Add a module parameter that allows user to completely disable CLx functionality in case problems are found. Signed-off-by: Gil Fine <gil.fine@intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2021-12-28thunderbolt: Enable CL0s for Intel Titan RidgeGil Fine
Low power link states (called collectively CLx) are used to reduce transmitter and receiver power when a high-speed lane is idle. The simplest one being called CL0s. Follow what we already do for USB4 device routers and enable CL0s for Intel Titan Ridge device router too. This allows better thermal management. Signed-off-by: Gil Fine <gil.fine@intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>