* [PATCH] staging: r8188eu: core: remove null check before vfree
@ 2021-08-28 17:54 Saurav Girepunje
2021-08-28 19:20 ` Michael Straube
2021-08-28 19:22 ` kernel test robot
0 siblings, 2 replies; 6+ messages in thread
From: Saurav Girepunje @ 2021-08-28 17:54 UTC (permalink / raw)
To: Larry.Finger, phil, gregkh, fabioaiuto83, straube.linux,
ross.schm.dev, linux-staging, linux-kernel
Cc: saurav.girepunje
Remove NULL check. NULL check before freeing function is not needed.
Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
---
drivers/staging/r8188eu/core/rtw_sta_mgt.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/staging/r8188eu/core/rtw_sta_mgt.c b/drivers/staging/r8188eu/core/rtw_sta_mgt.c
index f6dffed53a60..4726771a8403 100644
--- a/drivers/staging/r8188eu/core/rtw_sta_mgt.c
+++ b/drivers/staging/r8188eu/core/rtw_sta_mgt.c
@@ -155,9 +155,7 @@ u32 _rtw_free_sta_priv(struct sta_priv *pstapriv)
spin_unlock_bh(&pstapriv->sta_hash_lock);
/*===============================*/
- if (pstapriv->pallocated_stainfo_buf)
- vfree(pstapriv->pallocated_stainfo_buf);
- }
+ vfree(pstapriv->pallocated_stainfo_buf);
return _SUCCESS;
}
--
2.32.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] staging: r8188eu: core: remove null check before vfree
2021-08-28 17:54 [PATCH] staging: r8188eu: core: remove null check before vfree Saurav Girepunje
@ 2021-08-28 19:20 ` Michael Straube
2021-08-28 19:30 ` Michael Straube
2021-08-28 19:22 ` kernel test robot
1 sibling, 1 reply; 6+ messages in thread
From: Michael Straube @ 2021-08-28 19:20 UTC (permalink / raw)
To: Saurav Girepunje, Larry.Finger, phil, gregkh, fabioaiuto83,
ross.schm.dev, linux-staging, linux-kernel
Cc: saurav.girepunje
On 8/28/21 19:54, Saurav Girepunje wrote:
> Remove NULL check. NULL check before freeing function is not needed.
>
> Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
> ---
> drivers/staging/r8188eu/core/rtw_sta_mgt.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/staging/r8188eu/core/rtw_sta_mgt.c b/drivers/staging/r8188eu/core/rtw_sta_mgt.c
> index f6dffed53a60..4726771a8403 100644
> --- a/drivers/staging/r8188eu/core/rtw_sta_mgt.c
> +++ b/drivers/staging/r8188eu/core/rtw_sta_mgt.c
> @@ -155,9 +155,7 @@ u32 _rtw_free_sta_priv(struct sta_priv *pstapriv)
> spin_unlock_bh(&pstapriv->sta_hash_lock);
> /*===============================*/
>
> - if (pstapriv->pallocated_stainfo_buf)
> - vfree(pstapriv->pallocated_stainfo_buf);
> - }
> + vfree(pstapriv->pallocated_stainfo_buf);
>
> return _SUCCESS;
> }
> --
> 2.32.0
>
Acked-by: Michael Straube <straube.linux@gmail.com>
Thanks,
Michael
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] staging: r8188eu: core: remove null check before vfree
2021-08-28 17:54 [PATCH] staging: r8188eu: core: remove null check before vfree Saurav Girepunje
2021-08-28 19:20 ` Michael Straube
@ 2021-08-28 19:22 ` kernel test robot
1 sibling, 0 replies; 6+ messages in thread
From: kernel test robot @ 2021-08-28 19:22 UTC (permalink / raw)
To: Saurav Girepunje, Larry.Finger, phil, gregkh, fabioaiuto83,
straube.linux, ross.schm.dev, linux-staging, linux-kernel
Cc: kbuild-all, saurav.girepunje
[-- Attachment #1: Type: text/plain, Size: 3592 bytes --]
Hi Saurav,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on staging/staging-testing]
url: https://github.com/0day-ci/linux/commits/Saurav-Girepunje/staging-r8188eu-core-remove-null-check-before-vfree/20210829-015616
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 4adb389e08c95fdf91995271932c59250ff0d561
config: sh-allmodconfig (attached as .config)
compiler: sh4-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/9c7f84adad9db1009055b063408e70c89fc51170
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Saurav-Girepunje/staging-r8188eu-core-remove-null-check-before-vfree/20210829-015616
git checkout 9c7f84adad9db1009055b063408e70c89fc51170
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=sh SHELL=/bin/bash drivers/staging/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All error/warnings (new ones prefixed by >>):
drivers/staging/r8188eu/core/rtw_sta_mgt.c: In function '_rtw_free_sta_priv':
>> drivers/staging/r8188eu/core/rtw_sta_mgt.c:163:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
163 | struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
| ^~~~~~
>> drivers/staging/r8188eu/core/rtw_sta_mgt.c:506:1: error: expected declaration or statement at end of input
506 | }
| ^
drivers/staging/r8188eu/core/rtw_sta_mgt.c:507: error: control reaches end of non-void function [-Werror=return-type]
At top level:
drivers/staging/r8188eu/core/rtw_sta_mgt.c:469:4: warning: 'rtw_access_ctrl' defined but not used [-Wunused-function]
469 | u8 rtw_access_ctrl(struct adapter *padapter, u8 *mac_addr)
| ^~~~~~~~~~~~~~~
drivers/staging/r8188eu/core/rtw_sta_mgt.c:458:18: warning: 'rtw_get_bcmc_stainfo' defined but not used [-Wunused-function]
458 | struct sta_info *rtw_get_bcmc_stainfo(struct adapter *padapter)
| ^~~~~~~~~~~~~~~~~~~~
drivers/staging/r8188eu/core/rtw_sta_mgt.c:436:5: warning: 'rtw_init_bcmc_stainfo' defined but not used [-Wunused-function]
436 | u32 rtw_init_bcmc_stainfo(struct adapter *padapter)
| ^~~~~~~~~~~~~~~~~~~~~
drivers/staging/r8188eu/core/rtw_sta_mgt.c:367:6: warning: 'rtw_free_all_stainfo' defined but not used [-Wunused-function]
367 | void rtw_free_all_stainfo(struct adapter *padapter)
| ^~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for SND_ATMEL_SOC_PDC
Depends on SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC && HAS_DMA
Selected by
- SND_ATMEL_SOC_SSC && SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC
- SND_ATMEL_SOC_SSC_PDC && SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC && ATMEL_SSC
vim +506 drivers/staging/r8188eu/core/rtw_sta_mgt.c
15865124feed88 Phillip Potter 2021-07-28 504
15865124feed88 Phillip Potter 2021-07-28 505 return res;
15865124feed88 Phillip Potter 2021-07-28 @506 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 55027 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] staging: r8188eu: core: remove null check before vfree
2021-08-28 19:20 ` Michael Straube
@ 2021-08-28 19:30 ` Michael Straube
2021-08-28 19:47 ` Kari Argillander
0 siblings, 1 reply; 6+ messages in thread
From: Michael Straube @ 2021-08-28 19:30 UTC (permalink / raw)
To: Saurav Girepunje, Larry.Finger, phil, gregkh, fabioaiuto83,
ross.schm.dev, linux-staging, linux-kernel
Cc: saurav.girepunje
On 8/28/21 21:20, Michael Straube wrote:
> On 8/28/21 19:54, Saurav Girepunje wrote:
>> Remove NULL check. NULL check before freeing function is not needed.
>>
>> Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
>> ---
>> drivers/staging/r8188eu/core/rtw_sta_mgt.c | 4 +---
>> 1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/drivers/staging/r8188eu/core/rtw_sta_mgt.c
>> b/drivers/staging/r8188eu/core/rtw_sta_mgt.c
>> index f6dffed53a60..4726771a8403 100644
>> --- a/drivers/staging/r8188eu/core/rtw_sta_mgt.c
>> +++ b/drivers/staging/r8188eu/core/rtw_sta_mgt.c
>> @@ -155,9 +155,7 @@ u32 _rtw_free_sta_priv(struct sta_priv
>> *pstapriv)
>> spin_unlock_bh(&pstapriv->sta_hash_lock);
>> /*===============================*/
>>
>> - if (pstapriv->pallocated_stainfo_buf)
>> - vfree(pstapriv->pallocated_stainfo_buf);
>> - }
>> + vfree(pstapriv->pallocated_stainfo_buf);
>>
>> return _SUCCESS;
>> }
>> --
>> 2.32.0
>>
>
> Acked-by: Michael Straube <straube.linux@gmail.com>
>
> Thanks,
> Michael
Whoops, I missed that you removed the } that belongs to the enclosing if
block. Probably because it is not properly indented in the original
code.
Best regards,
Michael
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] staging: r8188eu: core: remove null check before vfree
2021-08-28 19:30 ` Michael Straube
@ 2021-08-28 19:47 ` Kari Argillander
2021-08-28 19:56 ` Michael Straube
0 siblings, 1 reply; 6+ messages in thread
From: Kari Argillander @ 2021-08-28 19:47 UTC (permalink / raw)
To: Michael Straube, Saurav Girepunje
Cc: Larry.Finger, phil, gregkh, fabioaiuto83, ross.schm.dev,
linux-staging, linux-kernel, saurav.girepunje
On Sat, Aug 28, 2021 at 09:30:14PM +0200, Michael Straube wrote:
> On 8/28/21 21:20, Michael Straube wrote:
> > On 8/28/21 19:54, Saurav Girepunje wrote:
> > > Remove NULL check. NULL check before freeing function is not needed.
> > >
> > > Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
> > > ---
> > > drivers/staging/r8188eu/core/rtw_sta_mgt.c | 4 +---
> > > 1 file changed, 1 insertion(+), 3 deletions(-)
> > >
> > > diff --git a/drivers/staging/r8188eu/core/rtw_sta_mgt.c
> > > b/drivers/staging/r8188eu/core/rtw_sta_mgt.c
> > > index f6dffed53a60..4726771a8403 100644
> > > --- a/drivers/staging/r8188eu/core/rtw_sta_mgt.c
> > > +++ b/drivers/staging/r8188eu/core/rtw_sta_mgt.c
> > > @@ -155,9 +155,7 @@ u32 _rtw_free_sta_priv(struct sta_priv
> > > *pstapriv)
> > > spin_unlock_bh(&pstapriv->sta_hash_lock);
> > > /*===============================*/
> > >
> > > - if (pstapriv->pallocated_stainfo_buf)
> > > - vfree(pstapriv->pallocated_stainfo_buf);
> > > - }
> > > + vfree(pstapriv->pallocated_stainfo_buf);
> > >
> > > return _SUCCESS;
> > > }
> > > --
> > > 2.32.0
> > >
> >
> > Acked-by: Michael Straube <straube.linux@gmail.com>
> >
> > Thanks,
> > Michael
>
> Whoops, I missed that you removed the } that belongs to the enclosing if
> block. Probably because it is not properly indented in the original
> code.
Easy to miss because that bracket is in wrong place in first place.
Michael can you now on even build test before sending. Thanks.
>
> Best regards,
> Michael
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] staging: r8188eu: core: remove null check before vfree
2021-08-28 19:47 ` Kari Argillander
@ 2021-08-28 19:56 ` Michael Straube
0 siblings, 0 replies; 6+ messages in thread
From: Michael Straube @ 2021-08-28 19:56 UTC (permalink / raw)
To: Kari Argillander, Saurav Girepunje
Cc: Larry.Finger, phil, gregkh, fabioaiuto83, ross.schm.dev,
linux-staging, linux-kernel, saurav.girepunje
On 8/28/21 21:47, Kari Argillander wrote:
> On Sat, Aug 28, 2021 at 09:30:14PM +0200, Michael Straube wrote:
>> On 8/28/21 21:20, Michael Straube wrote:
>>> On 8/28/21 19:54, Saurav Girepunje wrote:
>>>> Remove NULL check. NULL check before freeing function is not needed.
>>>>
>>>> Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
>>>> ---
>>>> drivers/staging/r8188eu/core/rtw_sta_mgt.c | 4 +---
>>>> 1 file changed, 1 insertion(+), 3 deletions(-)
>>>>
>>>> diff --git a/drivers/staging/r8188eu/core/rtw_sta_mgt.c
>>>> b/drivers/staging/r8188eu/core/rtw_sta_mgt.c
>>>> index f6dffed53a60..4726771a8403 100644
>>>> --- a/drivers/staging/r8188eu/core/rtw_sta_mgt.c
>>>> +++ b/drivers/staging/r8188eu/core/rtw_sta_mgt.c
>>>> @@ -155,9 +155,7 @@ u32 _rtw_free_sta_priv(struct sta_priv
>>>> *pstapriv)
>>>> spin_unlock_bh(&pstapriv->sta_hash_lock);
>>>> /*===============================*/
>>>>
>>>> - if (pstapriv->pallocated_stainfo_buf)
>>>> - vfree(pstapriv->pallocated_stainfo_buf);
>>>> - }
>>>> + vfree(pstapriv->pallocated_stainfo_buf);
>>>>
>>>> return _SUCCESS;
>>>> }
>>>> --
>>>> 2.32.0
>>>>
>>>
>>> Acked-by: Michael Straube <straube.linux@gmail.com>
>>>
>>> Thanks,
>>> Michael
>>
>> Whoops, I missed that you removed the } that belongs to the enclosing if
>> block. Probably because it is not properly indented in the original
>> code.
>
> Easy to miss because that bracket is in wrong place in first place.
>
> Michael can you now on even build test before sending. Thanks.
>
Sure, I usually do. For this one I did not but obviously I should have..
;)
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-08-28 19:56 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-28 17:54 [PATCH] staging: r8188eu: core: remove null check before vfree Saurav Girepunje
2021-08-28 19:20 ` Michael Straube
2021-08-28 19:30 ` Michael Straube
2021-08-28 19:47 ` Kari Argillander
2021-08-28 19:56 ` Michael Straube
2021-08-28 19:22 ` kernel test robot
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).