Re: [PATCH v3 1/4] staging: rtl8723bs: Remove comparisons to NULL in conditionals

From: Greg KH
Date: Fri Oct 11 2019 - 08:07:21 EST


On Fri, Oct 11, 2019 at 01:54:04PM +0300, Dan Carpenter wrote:
> On Thu, Oct 10, 2019 at 04:15:29PM +0300, Wambui Karuga wrote:
> > psetauthparm = rtw_zmalloc(sizeof(struct setauth_parm));
> > - if (psetauthparm == NULL) {
> > - kfree(pcmd);
> > + if (!psetauthparm) {
> > + kfree((unsigned char *)pcmd);
>
> This new cast is unnecessary and weird.

Ah, I missed that, good catch. I'll go drop this patch now.

Wambui, please fix up and resend.

thanks

greg k-h