Subject: Re: [PATCH net-next v3] em_canid: Ematch rule to match CAN frames according to their identifiers

From: Oliver Hartkopp <[email-masked]>
Date: Mon, 02 Jul 2012 20:03:27 +0200

One more simplification:

>> +	rulescnt = len / sizeof(struct can_filter);
>> +
>> +	cm = kzalloc(sizeof(struct canid_match) + sizeof(struct can_filter) *
>> +		rulescnt, GFP_KERNEL);

No need to multiply the value again  ... you can take the len value as-is:

cm = kzalloc(sizeof(struct canid_match) + len, GFP_KERNEL);

> 
> *cm is no longer a fixed structure as it was in the first patches.
> 
> Must be:
> 
> m->datalen = sizeof(struct canid_match) + sizeof(struct can_filter) * rulescnt

dito:

m->datalen = sizeof(struct canid_match) + len;

Regards,
Oliver