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 -- To unsubscribe from this list: send the line "unsubscribe lartc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html