Skip to content

Commit

Permalink
net/sfc: remove null dereference in log
Browse files Browse the repository at this point in the history
[ upstream commit d05ce802f39dd4a67c18f9dbe1a00901429ba191 ]

When ctx->sa is null, sfc_err(ctx->sa, ...) will trigger a null
dereference in the macro of sfc_err. Use SFC_GENERIC_LOG(ERR, ...)
to avoid that.

Fixes: 44db08d ("net/sfc: maintain controller to EFX interface mapping")

Signed-off-by: Weiguo Li <liweiguo@xencore.cn>
Reviewed-by: Ferruh Yigit <ferruh.yigit@amd.com>
  • Loading branch information
liwg06 authored and kevintraynor committed Nov 16, 2023
1 parent 616bc19 commit c24098a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/sfc/sfc_ethdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -2053,7 +2053,7 @@ sfc_process_mport_journal_cb(void *data, efx_mport_desc_t *mport,
struct sfc_mport_journal_ctx *ctx = data;

if (ctx == NULL || ctx->sa == NULL) {
sfc_err(ctx->sa, "received NULL context or SFC adapter");
SFC_GENERIC_LOG(ERR, "received NULL context or SFC adapter");
return EINVAL;
}

Expand Down

0 comments on commit c24098a

Please sign in to comment.