struct apr_rx_buf {
struct list_head node;
int len;
- uint8_t buf[];
+ uint8_t buf[] __counted_by(len);
};
/**
return -EINVAL;
}
- abuf = kzalloc(sizeof(*abuf) + len, GFP_ATOMIC);
+ abuf = kzalloc(struct_size(abuf, buf, len), GFP_ATOMIC);
if (!abuf)
return -ENOMEM;