[PATCH] staging: vt6656: Return on isr0 when zero.
When isr0 is zero there is nothing more todo so return and pull following code in. Signed-off-by: Malcolm Priestley --- drivers/staging/vt6656/usbpipe.c | 47 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/drivers/staging/vt6656/usbpipe.c b/drivers/staging/vt6656/usbpipe.c index 91b62c3dff7b..e8efdeadb1a7 100644 --- a/drivers/staging/vt6656/usbpipe.c +++ b/drivers/staging/vt6656/usbpipe.c @@ -196,32 +196,31 @@ static void vnt_int_process_data(struct vnt_private *priv) if (int_data->tsr3 & TSR_VALID) vnt_int_report_rate(priv, int_data->pkt3, int_data->tsr3); - if (int_data->isr0 != 0) { - if (int_data->isr0 & ISR_BNTX && - priv->op_mode == NL80211_IFTYPE_AP) - vnt_schedule_command(priv, WLAN_CMD_BECON_SEND); - - if (int_data->isr0 & ISR_TBTT && - priv->hw->conf.flags & IEEE80211_CONF_PS) { - if (!priv->wake_up_count) - priv->wake_up_count = - priv->hw->conf.listen_interval; - - if (priv->wake_up_count) - --priv->wake_up_count; - - /* Turn on wake up to listen next beacon */ - if (priv->wake_up_count == 1) - vnt_schedule_command(priv, -WLAN_CMD_TBTT_WAKEUP); - } - priv->current_tsf = le64_to_cpu(int_data->tsf); + if (!int_data->isr0) + return; + + if (int_data->isr0 & ISR_BNTX && priv->op_mode == NL80211_IFTYPE_AP) + vnt_schedule_command(priv, WLAN_CMD_BECON_SEND); + + if (int_data->isr0 & ISR_TBTT && + priv->hw->conf.flags & IEEE80211_CONF_PS) { + if (!priv->wake_up_count) + priv->wake_up_count = priv->hw->conf.listen_interval; - low_stats->dot11RTSSuccessCount += int_data->rts_success; - low_stats->dot11RTSFailureCount += int_data->rts_fail; - low_stats->dot11ACKFailureCount += int_data->ack_fail; - low_stats->dot11FCSErrorCount += int_data->fcs_err; + if (priv->wake_up_count) + --priv->wake_up_count; + + /* Turn on wake up to listen next beacon */ + if (priv->wake_up_count == 1) + vnt_schedule_command(priv, WLAN_CMD_TBTT_WAKEUP); } + + priv->current_tsf = le64_to_cpu(int_data->tsf); + + low_stats->dot11RTSSuccessCount += int_data->rts_success; + low_stats->dot11RTSFailureCount += int_data->rts_fail; + low_stats->dot11ACKFailureCount += int_data->ack_fail; + low_stats->dot11FCSErrorCount += int_data->fcs_err; } static void vnt_start_interrupt_urb_complete(struct urb *urb) -- 2.25.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: gasket: Check the return value of gasket_get_bar_index()
Check the return value of gasket_get_bar_index function as it can return a negative one (-EINVAL). If this happens, a negative index is used in the "gasket_dev->bar_data" array. Addresses-Coverity-ID: 1438542 ("Negative array index read") Fixes: 9a69f5087ccc2 ("drivers/staging: Gasket driver framework + Apex driver") Signed-off-by: Oscar Carter --- drivers/staging/gasket/gasket_core.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/staging/gasket/gasket_core.c b/drivers/staging/gasket/gasket_core.c index 8e0575fcb4c8..67325fbaf760 100644 --- a/drivers/staging/gasket/gasket_core.c +++ b/drivers/staging/gasket/gasket_core.c @@ -925,6 +925,10 @@ do_map_region(const struct gasket_dev *gasket_dev, struct vm_area_struct *vma, gasket_get_bar_index(gasket_dev, (vma->vm_pgoff << PAGE_SHIFT) + driver_desc->legacy_mmap_address_offset); + + if (bar_index < 0) + return DO_MAP_REGION_INVALID; + phys_base = gasket_dev->bar_data[bar_index].phys_base + phys_offset; while (mapped_bytes < map_length) { /* -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: wilc1000: Increase the size of wid_list array
Increase by one the size of wid_list array as index variable can reach a value of 5. If this happens, an out-of-bounds access is performed. Addresses-Coverity-ID: 1451981 ("Out-of-bounds access") Fixes: c5c77ba18ea66 ("staging: wilc1000: Add SDIO/SPI 802.11 driver") Signed-off-by: Oscar Carter --- drivers/staging/wilc1000/hif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/hif.c b/drivers/staging/wilc1000/hif.c index 6c7de2f8d3f2..128943c3be4f 100644 --- a/drivers/staging/wilc1000/hif.c +++ b/drivers/staging/wilc1000/hif.c @@ -151,7 +151,7 @@ int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type, void *user_arg, struct cfg80211_scan_request *request) { int result = 0; - struct wid wid_list[5]; + struct wid wid_list[6]; u32 index = 0; u32 i, scan_timeout; u8 *buffer; -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: wilc1000: Increase the size of wid_list array
On 01/05/20 10:32 pm, Oscar Carter wrote: > EXTERNAL EMAIL: Do not click links or open attachments unless you know the > content is safe > > Increase by one the size of wid_list array as index variable can reach a > value of 5. If this happens, an out-of-bounds access is performed. > > Addresses-Coverity-ID: 1451981 ("Out-of-bounds access") > Fixes: c5c77ba18ea66 ("staging: wilc1000: Add SDIO/SPI 802.11 driver") The code changes are fine. But the correct commit for Fixes tag should be Fixes: f5a3cb90b802d ("staging: wilc1000: add passive scan support") Regards, Ajay > Signed-off-by: Oscar Carter > --- > drivers/staging/wilc1000/hif.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/wilc1000/hif.c b/drivers/staging/wilc1000/hif.c > index 6c7de2f8d3f2..128943c3be4f 100644 > --- a/drivers/staging/wilc1000/hif.c > +++ b/drivers/staging/wilc1000/hif.c > @@ -151,7 +151,7 @@ int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 > scan_type, > void *user_arg, struct cfg80211_scan_request *request) > { > int result = 0; > - struct wid wid_list[5]; > + struct wid wid_list[6]; > u32 index = 0; > u32 i, scan_timeout; > u8 *buffer; > -- > 2.20.1 > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] media: atomisp: use add_qos_request instead of update
It doesn't make senst to update a request that was not created. So, instead of using cpu_latency_qos_update_request(), let's use, instead cpu_latency_qos_add_request() at device probing code. This should fix this issue: [9.691775] cpu_latency_qos_update_request called for unknown object [9.695279] WARNING: CPU: 3 PID: 523 at kernel/power/qos.c:296 cpu_latency_qos_update_request+0x3a/0xb0 [9.698826] Modules linked in: snd_soc_acpi_intel_match snd_rawmidi snd_soc_acpi snd_soc_rl6231 snd_soc_core ath mac80211 snd_compress snd_hdmi_lpe_audio ac97_bus hid_sensor_accel_3d snd_pcm_dmaengine hid_sensor_gyro_3d hid_sensor_trigger industrialio_triggered_buffer kfifo_buf hid_sensor_iio_common processor_thermal_device industrialio cfg80211 snd_pcm snd_seq intel_rapl_common atomisp(C+) libarc4 intel_soc_dts_iosf cros_ec_ishtp intel_xhci_usb_role_switch mei_txe cros_ec videobuf_vmalloc mei roles atomisp_ov2680(C) videobuf_core snd_seq_device snd_timer spi_pxa2xx_platform videodev snd mc dw_dmac intel_hid dw_dmac_core 8250_dw soundcore int3406_thermal int3400_thermal intel_int0002_vgpio acpi_pad acpi_thermal_rel soc_button_array int3403_thermal int340x_thermal_zone mac_hid sch_fq_codel parport_pc ppdev lp parport ip_tables x_tables autofs4 hid_sensor_custom hid_sensor_hub intel_ishtp_loader intel_ishtp_hid crct10dif_pclmul crc32_pclmul ghash_clmulni_intel i915 mmc_block i2c_algo_bit [9.698885] aesni_intel crypto_simd drm_kms_helper cryptd syscopyarea sysfillrect glue_helper sysimgblt fb_sys_fops cec intel_ish_ipc drm lpc_ich intel_ishtp hid_asus intel_soc_pmic_chtdc_ti asus_wmi i2c_hid sparse_keymap sdhci_acpi wmi video sdhci hid_generic usbhid hid [9.736699] CPU: 3 PID: 523 Comm: systemd-udevd Tainted: G C 5.7.0-rc1+ #2 [9.741309] Hardware name: ASUSTeK COMPUTER INC. T101HA/T101HA, BIOS T101HA.305 01/24/2018 [9.745962] RIP: 0010:cpu_latency_qos_update_request+0x3a/0xb0 [9.750615] Code: 89 e5 41 55 41 54 41 89 f4 53 48 89 fb 48 81 7f 28 e0 7f c6 9e 74 1c 48 c7 c6 60 f3 65 9e 48 c7 c7 e8 a9 99 9e e8 b2 a6 f9 ff <0f> 0b 5b 41 5c 41 5d 5d c3 0f 1f 44 00 00 44 3b 23 74 ef 44 89 e2 [9.760065] RSP: 0018:a865404f39c0 EFLAGS: 00010282 [9.764734] RAX: RBX: 9d2aefc84350 RCX: [9.769435] RDX: 9d2afbfa97c0 RSI: 9d2afbf99808 RDI: 9d2afbf99808 [9.774125] RBP: a865404f39d8 R08: 0304 R09: 00aa [9.778804] R10: R11: 0001 R12: [9.783491] R13: 9d2afb4640b0 R14: c07ecf20 R15: 9100 [9.788187] FS: 7efe67ff8880() GS:9d2afbf8() knlGS: [9.792864] CS: 0010 DS: ES: CR0: 80050033 [9.797482] CR2: 7ffc6424bdc8 CR3: 000178998000 CR4: 001006e0 [9.802126] Call Trace: [9.806775] atomisp_pci_probe.cold.19+0x15f/0x116f [atomisp] [9.811441] local_pci_probe+0x47/0x80 [9.816085] pci_device_probe+0xff/0x1b0 [9.820706] really_probe+0x1c8/0x3e0 [9.825247] driver_probe_device+0xd9/0x120 [9.829769] device_driver_attach+0x58/0x60 [9.834294] __driver_attach+0x8f/0x150 [9.838782] ? device_driver_attach+0x60/0x60 [9.843205] ? device_driver_attach+0x60/0x60 [9.847634] bus_for_each_dev+0x79/0xc0 [9.852033] ? kmem_cache_alloc_trace+0x167/0x230 [9.856462] driver_attach+0x1e/0x20 Reported-by: Patrik Gfeller Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/media/atomisp/pci/atomisp_v4l2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c index 297f55a01b1b..f1bae9712720 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c +++ b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c @@ -1751,7 +1751,7 @@ static int atomisp_pci_probe(struct pci_dev *dev, atomisp_msi_irq_init(isp, dev); - cpu_latency_qos_update_request(&isp->pm_qos, PM_QOS_DEFAULT_VALUE); + cpu_latency_qos_add_request(&isp->pm_qos, PM_QOS_DEFAULT_VALUE); /* * for MRFLD, Software/firmware needs to write a 1 to bit 0 of -- 2.25.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v9 1/2] dt-bindings: drm/bridge: anx7625: MIPI to DP transmitter binding
On Thu, 30 Apr 2020 17:34:11 +0800, Xin Ji wrote: > The ANX7625 is an ultra-low power 4K Mobile HD Transmitter designed > for portable device. It converts MIPI to DisplayPort 1.3 4K. > > You can add support to your board with binding. > > Example: > anx7625_bridge: encoder@58 { > compatible = "analogix,anx7625"; > reg = <0x58>; > status = "okay"; > enable-gpios = <&pio 45 GPIO_ACTIVE_HIGH>; > reset-gpios = <&pio 73 GPIO_ACTIVE_HIGH>; > #address-cells = <1>; > #size-cells = <0>; > > ports { > #address-cells = <1>; > #size-cells = <0>; > > mipi2dp_bridge_in: port@0 { > reg = <0>; > anx7625_in: endpoint { > remote-endpoint = <&mipi_dsi>; > }; > }; > > mipi2dp_bridge_out: port@1 { > reg = <1>; > anx7625_out: endpoint { > remote-endpoint = <&panel_in>; > }; > }; > }; > }; > > Signed-off-by: Xin Ji > --- > .../bindings/display/bridge/analogix,anx7625.yaml | 97 > ++ > 1 file changed, 97 insertions(+) > create mode 100644 > Documentation/devicetree/bindings/display/bridge/analogix,anx7625.yaml > My bot found errors running 'make dt_binding_check' on your patch: Documentation/devicetree/bindings/display/bridge/analogix,anx7625.example.dts:21.13-26: Warning (reg_format): /example-0/encoder@58:reg: property has invalid length (4 bytes) (#address-cells == 1, #size-cells == 1) Documentation/devicetree/bindings/display/bridge/analogix,anx7625.example.dt.yaml: Warning (pci_device_reg): Failed prerequisite 'reg_format' Documentation/devicetree/bindings/display/bridge/analogix,anx7625.example.dt.yaml: Warning (pci_device_bus_num): Failed prerequisite 'reg_format' Documentation/devicetree/bindings/display/bridge/analogix,anx7625.example.dt.yaml: Warning (simple_bus_reg): Failed prerequisite 'reg_format' Documentation/devicetree/bindings/display/bridge/analogix,anx7625.example.dt.yaml: Warning (i2c_bus_reg): Failed prerequisite 'reg_format' Documentation/devicetree/bindings/display/bridge/analogix,anx7625.example.dt.yaml: Warning (spi_bus_reg): Failed prerequisite 'reg_format' See https://patchwork.ozlabs.org/patch/1280084 If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure dt-schema is up to date: pip3 install git+https://github.com/devicetree-org/dt-schema.git@master --upgrade Please check and re-submit. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8723bs: os_dep: Cleanup pointer casting code style
Cleanup by adding a space between type and pointer, in accordance with checkpatch.pl message "(foo*)" should be "(foo *)". Signed-off-by: Yu Jian Wu --- .../staging/rtl8723bs/os_dep/ioctl_cfg80211.c| 16 drivers/staging/rtl8723bs/os_dep/recv_linux.c| 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c index b037868fbf22..8377bc75e308 100644 --- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c @@ -98,7 +98,7 @@ static struct ieee80211_channel rtw_2ghz_channels[] = { static void rtw_2g_channels_init(struct ieee80211_channel *channels) { - memcpy((void*)channels, (void*)rtw_2ghz_channels, + memcpy((void *)channels, (void *)rtw_2ghz_channels, sizeof(struct ieee80211_channel)*RTW_2G_CHANNELS_NUM ); } @@ -133,8 +133,8 @@ static struct ieee80211_supported_band *rtw_spt_band_alloc( if (!spt_band) goto exit; - spt_band->channels = (struct ieee80211_channel*)(((u8 *)spt_band)+sizeof(struct ieee80211_supported_band)); - spt_band->bitrates = (struct ieee80211_rate*)(((u8 *)spt_band->channels)+sizeof(struct ieee80211_channel)*n_channels); + spt_band->channels = (struct ieee80211_channel *)(((u8 *)spt_band)+sizeof(struct ieee80211_supported_band)); + spt_band->bitrates = (struct ieee80211_rate *)(((u8 *)spt_band->channels)+sizeof(struct ieee80211_channel)*n_channels); spt_band->band = band; spt_band->n_channels = n_channels; spt_band->n_bitrates = n_bitrates; @@ -347,7 +347,7 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(struct adapter *padapter, struct wl memcpy(pbuf, pnetwork->network.IEs, pnetwork->network.IELength); len += pnetwork->network.IELength; - *((__le64*)pbuf) = cpu_to_le64(notify_timestamp); + *((__le64 *)pbuf) = cpu_to_le64(notify_timestamp); bss = cfg80211_inform_bss_frame(wiphy, notify_channel, (struct ieee80211_mgmt *)buf, len, notify_signal, GFP_ATOMIC); @@ -1118,7 +1118,7 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev, else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) { if (mac_addr) - memcpy(param->sta_addr, (void*)mac_addr, ETH_ALEN); + memcpy(param->sta_addr, (void *)mac_addr, ETH_ALEN); ret = rtw_cfg80211_ap_set_encryption(ndev, param, param_len); } @@ -2474,7 +2474,7 @@ static netdev_tx_t rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, struc * for two MAC addresses */ skb_pull(skb, dot11_hdr_len + qos_len + snap_len - sizeof(src_mac_addr) * 2); - pdata = (unsigned char*)skb->data; + pdata = (unsigned char *)skb->data; memcpy(pdata, dst_mac_addr, sizeof(dst_mac_addr)); memcpy(pdata + sizeof(dst_mac_addr), src_mac_addr, sizeof(src_mac_addr)); @@ -2529,7 +2529,7 @@ static netdev_tx_t rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, struc pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - memcpy(pframe, (void*)buf, len); + memcpy(pframe, (void *)buf, len); pattrib->pktlen = len; pwlanhdr = (struct ieee80211_hdr *)pframe; @@ -3019,7 +3019,7 @@ static int _cfg80211_rtw_mgmt_tx(struct adapter *padapter, u8 tx_ch, const u8 *b pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - memcpy(pframe, (void*)buf, len); + memcpy(pframe, (void *)buf, len); pattrib->pktlen = len; pwlanhdr = (struct ieee80211_hdr *)pframe; diff --git a/drivers/staging/rtl8723bs/os_dep/recv_linux.c b/drivers/staging/rtl8723bs/os_dep/recv_linux.c index 60c35d92ba29..0535dabc1bf5 100644 --- a/drivers/staging/rtl8723bs/os_dep/recv_linux.c +++ b/drivers/staging/rtl8723bs/os_dep/recv_linux.c @@ -230,7 +230,7 @@ static void rtw_os_ksocket_send(struct adapter *padapter, union recv_frame *prec if (rx_pid == psta->pid) { int i; - u16 len = *(u16*)(skb->data+ETH_HLEN+2); + u16 len = *(u16 *)(skb->data+ETH_HLEN+2); DBG_871X("eth, RC: len = 0x%x\n", len); for (i = 0; i < len; i++) -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel