Re: [PATCH] staging: rtl8723bs: remove an redundant null check before kfree()

From: Greg KH
Date: Mon Oct 28 2019 - 12:24:38 EST


On Tue, Oct 29, 2019 at 12:05:02AM +0800, zhong jiang wrote:
> On 2019/10/25 10:42, Greg KH wrote:
> > On Wed, Oct 16, 2019 at 03:38:26PM +0800, zhong jiang wrote:
> >> kfree() has taken null pointer into account. hence it is safe to remove
> >> the unnecessary check.
> >>
> >> Signed-off-by: zhong jiang <zhongjiang@xxxxxxxxxx>
> >> ---
> >> drivers/staging/rtl8723bs/core/rtw_xmit.c | 3 +--
> >> 1 file changed, 1 insertion(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c
> >> index 7011c2a..4597f4f 100644
> >> --- a/drivers/staging/rtl8723bs/core/rtw_xmit.c
> >> +++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c
> >> @@ -2210,8 +2210,7 @@ void rtw_free_hwxmits(struct adapter *padapter)
> >> struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
> >>
> >> hwxmits = pxmitpriv->hwxmits;
> >> - if (hwxmits)
> >> - kfree(hwxmits);
> >> + kfree(hwxmits);
> >> }
> >>
> >> void rtw_init_hwxmits(struct hw_xmit *phwxmit, sint entry)
> >> --
> >> 1.7.12.4
> >>
> > Patch does not apply to my tree :(
> >
> > .
> >
> Greg, Could you apply the patch to your tree ?

It did not apply, so what do you want me to do with it?

confused,

greg k-h