LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* staging: Add rtl8723bs sdio wifi driver
@ 2019-05-21 13:49 Colin Ian King
  2019-05-21 16:57 ` Hans de Goede
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2019-05-21 13:49 UTC (permalink / raw)
  To: Hans de Goede, Greg Kroah-Hartman, devel; +Cc: linux-kernel

Hi,

static analysis with Coverity has detected an issues in the rtl8723bs
wifi driver:

File: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c in function
rtw_dbg_port():

CID 18480: Operands don't affect result (CONSTANT_EXPRESSION_RESULT)
dead_error_condition: The condition (extra_arg & 7U) > 7U cannot be true.

        if ((extra_arg & 0x07) > 0x07)
                padapter->driver_ampdu_spacing = 0xFF;
        else
                padapter->driver_ampdu_spacing = extra_arg;


I'm not sure if the mask is (in)correct or the value it is being
compared to 0x07 is (in)correct (or both!)

Colin

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: staging: Add rtl8723bs sdio wifi driver
  2019-05-21 13:49 staging: Add rtl8723bs sdio wifi driver Colin Ian King
@ 2019-05-21 16:57 ` Hans de Goede
  0 siblings, 0 replies; 2+ messages in thread
From: Hans de Goede @ 2019-05-21 16:57 UTC (permalink / raw)
  To: Colin Ian King, Greg Kroah-Hartman, devel; +Cc: linux-kernel

Hi,

On 5/21/19 3:49 PM, Colin Ian King wrote:
> Hi,
> 
> static analysis with Coverity has detected an issues in the rtl8723bs
> wifi driver:
> 
> File: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c in function
> rtw_dbg_port():
> 
> CID 18480: Operands don't affect result (CONSTANT_EXPRESSION_RESULT)
> dead_error_condition: The condition (extra_arg & 7U) > 7U cannot be true.
> 
>          if ((extra_arg & 0x07) > 0x07)
>                  padapter->driver_ampdu_spacing = 0xFF;
>          else
>                  padapter->driver_ampdu_spacing = extra_arg;
> 
> 
> I'm not sure if the mask is (in)correct or the value it is being
> compared to 0x07 is (in)correct (or both!)

Hmm, after looking at the rest of the code, it is clear that valid
values for driver_ampdu_spacing or 0 - 7, otherwise it should
be set to 0xff which means use the driver default.

I will send a patch fixing this.

Regards,

Hans


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-05-21 16:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-21 13:49 staging: Add rtl8723bs sdio wifi driver Colin Ian King
2019-05-21 16:57 ` Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).