DPDK patches and discussions
 help / color / mirror / Atom feed
From: Weiguo Li <liwg06@foxmail.com>
To: viacheslav.galaktionov@arknetworks.am
Cc: andrew.rybchenko@oktetlabs.ru, dev@dpdk.org, stable@dpdk.org,
	Weiguo Li <liweiguo@xencore.cn>
Subject: [PATCH] net/sfc: fix null dereference in syslog
Date: Sat,  4 Nov 2023 15:37:15 +0800	[thread overview]
Message-ID: <tencent_3688599DB9EF8F116B918398669E9ED3C107@qq.com> (raw)

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

Fixes: 44db08d53be3 ("net/sfc: maintain controller to EFX interface mapping")
Cc: stable@dpdk.org

Signed-off-by: Weiguo Li <liweiguo@xencore.cn>
---
 drivers/net/sfc/sfc_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index 1efe64a36a..6d57b2ba26 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -2070,7 +2070,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;
 	}
 
-- 
2.34.1


             reply	other threads:[~2023-11-04  7:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-04  7:37 Weiguo Li [this message]
2023-11-06 11:37 ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tencent_3688599DB9EF8F116B918398669E9ED3C107@qq.com \
    --to=liwg06@foxmail.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=liweiguo@xencore.cn \
    --cc=stable@dpdk.org \
    --cc=viacheslav.galaktionov@arknetworks.am \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).