Messages in this thread | | | Subject | Re: [PATCH v2] drivers/net/usb/hso.c: prevent reading uninitialized memory | From | Steven Rostedt <> | Date | Thu, 16 Sep 2010 12:52:40 -0400 |
| |
On Thu, 2010-09-16 at 18:07 +0100, Alan Cox wrote: > ->tiocmget; > > > > > > + memset(&icount, 0, sizeof(struct serial_icounter_struct)); > > > + > > > > Move the above to after the spinlocks. > > Why - its a local variable ? > > Easier to write > > struct serial_icounter_struct icount = { 0 }; > > though
True, but if we want to micro-optimize, moving it after the spinlocks means we do no zero initialization in the tiocmget == 0. Although gcc may be smart enough to realize that too.
-- Steve
| |