* [PATCH -next] staging: rtl8723bs: core: fix error return
@ 2021-03-25 8:30 Xu Jia
2021-03-26 14:08 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Xu Jia @ 2021-03-25 8:30 UTC (permalink / raw)
To: gregkh, ross.schm.dev; +Cc: linux-kernel, linux-staging, hulkcommits
Function rtw_init_bcmc_stainfo() is always return success.
Variable 'ret' set but not used.
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Xu Jia <xujia39@huawei.com>
---
drivers/staging/rtl8723bs/core/rtw_sta_mgt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
index f96dd0b40e04..7b578192adf5 100644
--- a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
+++ b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
@@ -551,7 +551,7 @@ u32 rtw_init_bcmc_stainfo(struct adapter *padapter)
psta->mac_id = 1;
exit:
- return _SUCCESS;
+ return res;
}
struct sta_info *rtw_get_bcmc_stainfo(struct adapter *padapter)
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] staging: rtl8723bs: core: fix error return
2021-03-25 8:30 [PATCH -next] staging: rtl8723bs: core: fix error return Xu Jia
@ 2021-03-26 14:08 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2021-03-26 14:08 UTC (permalink / raw)
To: Xu Jia; +Cc: ross.schm.dev, linux-kernel, linux-staging, hulkcommits
On Thu, Mar 25, 2021 at 04:30:41PM +0800, Xu Jia wrote:
> Function rtw_init_bcmc_stainfo() is always return success.
> Variable 'ret' set but not used.
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Xu Jia <xujia39@huawei.com>
> ---
> drivers/staging/rtl8723bs/core/rtw_sta_mgt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
> index f96dd0b40e04..7b578192adf5 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
> @@ -551,7 +551,7 @@ u32 rtw_init_bcmc_stainfo(struct adapter *padapter)
> psta->mac_id = 1;
>
> exit:
> - return _SUCCESS;
> + return res;
> }
You just changed the logic of this function, now it can return a
failure. Is that ok? have you tested it when this fails?
Given that I do not think anyone actually tests this value, should this
function just return void instead?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-03-26 14:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-25 8:30 [PATCH -next] staging: rtl8723bs: core: fix error return Xu Jia
2021-03-26 14:08 ` Greg KH
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).