From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4DDC743284; Sat, 4 Nov 2023 08:37:47 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0D7EB4029E; Sat, 4 Nov 2023 08:37:47 +0100 (CET) Received: from out203-205-221-191.mail.qq.com (out203-205-221-191.mail.qq.com [203.205.221.191]) by mails.dpdk.org (Postfix) with ESMTP id DD1714028B; Sat, 4 Nov 2023 08:37:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1699083449; bh=93mQR5u6Qx7O660jAhOrYcGnJCv4L4afvVoL/hoKzpo=; h=From:To:Cc:Subject:Date; b=memF4lJt7EOR4SUAz+B9ncWulMYCyrHNBhBhFTbD/DKCwGT5g9MYfZn9V5Gb1Q2Xc qPCwngAP2XoQP0uACJHL36ZvFKvwq2SPeQJEOIhYFyW9DJxWT4g8nV7bG/i1QpUxy0 m/ba4pnIvICgkrNBMYSW6lyLTKhdGcB/4DqQjao4= Received: from liwg-V5320.. ([36.112.73.58]) by newxmesmtplogicsvrsza7-0.qq.com (NewEsmtp) with SMTP id 94F200A5; Sat, 04 Nov 2023 15:37:15 +0800 X-QQ-mid: xmsmtpt1699083435t16i6wevv Message-ID: X-QQ-XMAILINFO: MflS1P6hJntI7w6SA9KDf1UI2uDOe0Qrrlyu+ocdYXREU+ZOzSV+8kLM9iMZKb pWXnxYRu3+k7Dyit+AmHMQ6TOuB85L49rJNdwR/W+K0jk7WLqS68cJGNY6ZWH+Ixr+cQBh2u8azB Pycuq3g6HBrhr5eWIS1jraycrcl/MMRKE2nCZ21YFOLBwwKDvvVhUICW+N5yQPDdirdV8zKLJ1Rl uikGRthtisAQbR2xsq/PCqMPyYt15VxB1AmDZE531qyQ1WVFzRRGm1HUXPmND8ztZRCJxLo/cjGi DiClVCLWrANWR+HpYoynapyaKTil5pgjXVbKGLwpF46/7Es3Trw63YqAljQJI6Bg4KjFD7y27TIk NMny/sCO7zQXalbiePdczcmedsvzi3viQNq7baXaVHCKz3VJrWlfgE23GQrTh4jO4SCCV8e0p1G1 vbqf0AIrpeiLIwObN3rGG32VJuWVyuvwr3mIDYJIFUeCWUqHOfQERwysQYlRQX8qCSKCz0IcNh+R CiyejIKbbo9tMRyP/OrRJkR1HFwFlE7M6I6YB/uSL5wrr2Jfr1qeClc4CvWNse9BwVTTGfe3ua6n DAcf4FVAha0z7YbDO0/WhqDScic0kx23F2L1OLNi4V8Lm9K+I1dnZO/Jx6EqXa/OutQnzWLV17ZP rHSrGPg5FDcoik/DGOxYRlXciVlVZNSMC5ayE4pvQfmmw4pnXtQY2hFpJcvizhRvePdSfaHDE6hk T2ZyL/HvQGZ8vg/uopxD0rP+LlaWEvXAXDSwOPk1dGnkf+3i2FbDEVXjdvPOJ2g/+aqIUwLWH08B fRxeKufvueXbso6L22358M2rZz1YY0yBcOJbDOkSEUYphrhL1y45e/j0d2u9+Gfuf/ch+UcFLOJE sWDzq7zkG2xLkmwzB03CrhBP0wn1msYn3RlCrDd2OdTjceKtT1nwUUVBnAXBok3hf5Jm6giszrvz NTH6CiOpbvuiNVhpH1MkTHa+WDEpN/XhCZqRnGrpwSBtDMikSrFBJZv8JiX0kt X-QQ-XMRINFO: MSVp+SPm3vtS1Vd6Y4Mggwc= From: Weiguo Li To: viacheslav.galaktionov@arknetworks.am Cc: andrew.rybchenko@oktetlabs.ru, dev@dpdk.org, stable@dpdk.org, Weiguo Li Subject: [PATCH] net/sfc: fix null dereference in syslog Date: Sat, 4 Nov 2023 15:37:15 +0800 X-OQ-MSGID: <20231104073715.2066107-1-liwg06@foxmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 --- 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