Re: [PATCH] net: fix /proc/net/snmp as memory corruptor

David Stevens
2008-11-08T21:05:15Z

>
> If you are not sure what I am talking about, then you should probably
> not use static variables at all. I found this fix quite obvious...

Actually, I didn't realize "out" was static -- was looking at just
the patch, and obviously missing your point.
I don't have a problem with 16 ints on the stack (or shorts, as
you pointed out)-- I didn't want the data on the stack, which may be
64-bit ints. In your patch, you're collecting all of it on the stack
(doubling its size).
If there is no interlocking at a higher layer (and I haven't
looked
at this in a long time...) (ie, exclusive opens), then I agree, it
shouldn't be static.

Why not just that? (ie, add count=0 as Alexey did and remove the
static qualifier from "out")

+-DLS