Re: Re: [PATCH] staging: r8188eu: fix a potential memory leak in _rtw_init_cmd_priv()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 30 Mar 2022 19:43:40 +0800, gregkh@xxxxxxxxxxxxxxxxxxx wrote:
>>  if (!pcmdpriv->rsp_allocated_buf) {
>> +	kfree(pcmdpriv->cmd_allocated_buf);
>> +	pcmdpriv->cmd_allocated_buf = NULL;
>>  res = _FAIL;
>>  goto exit;

>Shouldn't this be handled properly in the exit: portion instead?

I think this is ok since we do not need to free it in normal exit.
But if you like that, I can add an err label and move the operations
to there.
Or maybe we can directly return the status rather than changing
`res` since there are only two possibilities.

Regards,
Xiaoke Wang







[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux