All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] sfc: add mport lookup based on driver's mport data
@ 2025-08-07 16:00 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2025-08-07 16:00 UTC (permalink / raw)
  To: Alejandro Lucero; +Cc: kernel-janitors, linux-net-drivers

Hello Alejandro Lucero,

Commit 5227adff37af ("sfc: add mport lookup based on driver's mport
data") from Feb 15, 2023 (linux-next), leads to the following Smatch
static checker warning:

	drivers/net/ethernet/sfc/mae.c:1035 efx_mae_lookup_mport()
	error: 'm' dereferencing possible ERR_PTR()

drivers/net/ethernet/sfc/mae.c
    1024 int efx_mae_lookup_mport(struct efx_nic *efx, u32 vf_idx, u32 *id)
    1025 {
    1026         struct ef100_nic_data *nic_data = efx->nic_data;
    1027         struct efx_mae *mae = efx->mae;
    1028         struct rhashtable_iter walk;
    1029         struct mae_mport_desc *m;
    1030         int rc = -ENOENT;
    1031 
    1032         rhashtable_walk_enter(&mae->mports_ht, &walk);
    1033         rhashtable_walk_start(&walk);
    1034         while ((m = rhashtable_walk_next(&walk)) != NULL) {

rhashtable_walk_next() returns NULL if we get to the end, but it
returns ERR_PTR(-EAGAIN) if the hashtable was resized.  I don't know the
code well enough to say if that's possible here.

--> 1035                 if (m->mport_type == MAE_MPORT_DESC_MPORT_TYPE_VNIC &&
    1036                     m->interface_idx == nic_data->local_mae_intf &&
    1037                     m->pf_idx == 0 &&
    1038                     m->vf_idx == vf_idx) {
    1039                         *id = m->mport_id;
    1040                         rc = 0;
    1041                         break;
    1042                 }
    1043         }
    1044         rhashtable_walk_stop(&walk);
    1045         rhashtable_walk_exit(&walk);
    1046         return rc;
    1047 }

regards,
dan carpenter

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-08-07 16:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-07 16:00 [bug report] sfc: add mport lookup based on driver's mport data Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.