On 11/5/25 8:19 AM, Simon Horman wrote:
> On Mon, Nov 03, 2025 at 04:55:07PM -0600, Daniel Jurgens wrote:
>
> ...
>
>> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
>
> ...
>
>> +static int virtnet_ff_init(struct virtnet_ff *ff, struct virtio_device
>> *vdev)
>> +{
>> + size_t ff_mask_size = sizeof(struct virtio_net_ff_cap_mask_data) +
>> + sizeof(struct virtio_net_ff_selector) *
>> +
>> + ff->ff_caps = kzalloc(sizeof(*ff->ff_caps), GFP_KERNEL);
>> + if (!ff->ff_caps)
>
> Hi Daniel,
>
> I think that err needs to be set to a negative error value here...
>
>> + goto err_cap_list;
>> +
>> + err = virtio_admin_cap_get(vdev,
>> + VIRTIO_NET_FF_RESOURCE_CAP,
>> + ff->ff_caps,
>> + sizeof(*ff->ff_caps));
>> +
>> + ff->ff_actions = kzalloc(sizeof(*ff->ff_actions) +
>> + VIRTIO_NET_FF_ACTION_MAX,
>> + GFP_KERNEL);
>> + if (!ff->ff_actions)
>
> ... and here.
>
> Flagged by Smatch.
>
>> + goto err_ff_mask;
Thanks Simon, missed that when I changed it to return a value. I'll spin
a v9.