svn commit: r273051 - head/sys/dev/isp

Warner Losh imp at bsdimp.com
Wed Oct 15 01:58:40 UTC 2014


On Oct 14, 2014, at 7:51 PM, John-Mark Gurney <jmg at funkthat.com> wrote:

> Warner Losh wrote this message on Mon, Oct 13, 2014 at 16:23 +0000:
>> Author: imp
>> Date: Mon Oct 13 16:23:58 2014
>> New Revision: 273051
>> URL: https://svnweb.freebsd.org/changeset/base/273051
>> 
>> Log:
>>  Use the C99 flexible array construct to denote a variable amount of
>>  data rather than the old-school [1] construct. We have required c99
>>  compilers for some time.
> 
> Have you audited that there aren't any mallocs or anything else that
> needs to be adjusted? i.e. old code that did:
> var = malloc(sizeof(sns_screq_t) + sizeof(uint16_t) * (cnt - 1));
> 
> Will now allocate too few bytes...

I audited it. These structures are never malloced and only used to
describe structures that are passed back and forth to the firmware.
When used in host memory, there’s a fixed allocation size that’s
independent of the structure size. And they are used in like 3 or 4
places that I could find.

Did I miss something?

Warner

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freebsd.org/pipermail/svn-src-head/attachments/20141014/cc676023/attachment.sig>


More information about the svn-src-head mailing list