Re: [PATCH v3 2/3] Staging: rtl8192e: Using kzalloc and delete memset

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

 



On Wed, Jun 22, 2022 at 05:12:45PM +0200, Felix Schlepper wrote:
> By using kzalloc, we can delete a memset and avoid
> memory initialization defects.
>

This commit message is slightly confusing.  The "avoid memory
initialization defects" bit is very vague.

The difference between the original code and patched code is that the
patched code zeroes out the txb->fragments[] array.  The original code
worked.  The new code is slightly cleaner, but also slower.  Whatever,
either way is fine.

But just state it clearly in the commit message.

  "By using kzalloc, we can delete a memset.  The practical difference
   is that using kzalloc() will zero out the txb->fragments[] array.
   The original code worked fine, but zeroing everything seems nicer."

regards,
dan carpenter





[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