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

From: Dan Carpenter
Date: Fri Oct 11 2019 - 06:54:22 EST


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.

> res = _FAIL;
> goto exit;
> }

regards,
dan carpenter