Skip to contentSkip to conversation

RDMA/mlx5: Switch from MR cache to FRMR pools

bug report Dan Carpenter 1 participant 1 message Apr 10 InfiniBand

lore
Share & tools
lore
#0 lore raw

Hello Michael Guralnik,

Commit 36680ef7bceb ("RDMA/mlx5: Switch from MR cache to FRMR pools") from Feb 26, 2026 (linux-next), leads to the following Smatch static checker warning:

	drivers/infiniband/hw/mlx5/mr.c:299 mlx5r_create_mkeys()
	warn: why is zero skipped 'i'

drivers/infiniband/hw/mlx5/mr.c

    289         for (i = 0; i < count; i++) {
    290                 assign_mkey_variant(dev, handles + i, in);
    291                 err = mlx5_core_create_mkey(dev->mdev, handles + i, in, inlen);
    292                 if (err)
    293                         goto free_in;
    294         }
    295 free_in:
    296         kfree(in);
    297         if (err)
    298                 for (; i > 0; i--)
                               ^^^^^

This should be >= 0 or we leak the first array element.

--> 299                         mlx5_core_destroy_mkey(dev->mdev, handles[i]);
    300         return err;
    301 }

This email is a free service from the Smatch-CI project [smatch.sf.net].

regards,
dan carpenter