From patchwork Fri Mar 21 08:13:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Malladi, Meghana" X-Patchwork-Id: 14024973 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 637A4C35FF3 for ; Fri, 21 Mar 2025 08:16:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=HPcqz3zgaVT4xyh7yJnKcfMahOu64DyRAGZO/Z934DQ=; b=CAa3UJ+8+zGryyhUHSG93n70MD t7IXeMMdp5CUqbcNprympQqA6AxknGry73N8ijmgvyGC4CdaY88Wc0PRiqCO241LQBTvNRXmDb6I0 r2OP6lVpO6JerYvsoMkuQ6JYicPCzejLX1VWpHRTRmpV+Qc82X6Wt3FxST5lwAup3stxlOW6ytGtT 1lQE/92FO7bgdO4+ZHWHLqLTk46D2BABBlDBVlGlCN6lBt1wHCflKnst9W+RLo6BtS9CiIlDVGH7e rarm4XdhRCC/WKVnr9+QIjH3n6vVx3M0Jq6tovzUvEmgn0Y/IS1B0DyUdXth/em7586XrmQVY055B EALZMeKg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tvXY7-0000000EEFg-407l; Fri, 21 Mar 2025 08:16:15 +0000 Received: from fllvem-ot03.ext.ti.com ([198.47.19.245]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tvXVf-0000000EDVa-2hJy for linux-arm-kernel@lists.infradead.org; Fri, 21 Mar 2025 08:13:45 +0000 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllvem-ot03.ext.ti.com (8.15.2/8.15.2) with ESMTPS id 52L8DMhl262195 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 21 Mar 2025 03:13:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1742544802; bh=HPcqz3zgaVT4xyh7yJnKcfMahOu64DyRAGZO/Z934DQ=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=jesHHUWwO0kkYw46DL4xIzHw1Rq0bd1607wbjLnfQUW4iPx4uRbMHsIZrR+o6qMcG nNTzKSQbhcCSSuockmSKqjgC+i7BDsntcM90x/0+9D53OiHYmbLyuXhHhnX1/15qay Ys67aI8lk4Q9cDDElvF39pjasjSMLF73miHdiZ0U= Received: from DLEE104.ent.ti.com (dlee104.ent.ti.com [157.170.170.34]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTP id 52L8DMbS127576; Fri, 21 Mar 2025 03:13:22 -0500 Received: from DLEE107.ent.ti.com (157.170.170.37) by DLEE104.ent.ti.com (157.170.170.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Fri, 21 Mar 2025 03:13:21 -0500 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Fri, 21 Mar 2025 03:13:21 -0500 Received: from lelv0854.itg.ti.com (lelv0854.itg.ti.com [10.181.64.140]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 52L8DL5R130181; Fri, 21 Mar 2025 03:13:21 -0500 Received: from localhost (meghana-pc.dhcp.ti.com [10.24.69.13] (may be forged)) by lelv0854.itg.ti.com (8.14.7/8.14.7) with ESMTP id 52L8DKvx032428; Fri, 21 Mar 2025 03:13:21 -0500 From: Meghana Malladi To: , , , , CC: , , , , , , , , , , , , , , , , Vignesh Raghavendra , Roger Quadros , Subject: [PATCH net-next v2 1/3] net: ti: prueth: Fix kernel warning while bringing down network interface Date: Fri, 21 Mar 2025 13:43:11 +0530 Message-ID: <20250321081313.37112-2-m-malladi@ti.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250321081313.37112-1-m-malladi@ti.com> References: <20250321081313.37112-1-m-malladi@ti.com> MIME-Version: 1.0 X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250321_011343_768941_553E88EF X-CRM114-Status: GOOD ( 11.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org During network interface initialization, the NIC driver needs to register its Rx queue with the XDP, to ensure the incoming XDP buffer carries a pointer reference to this info and is stored inside xdp_rxq_info. While this struct isn't tied to XDP prog, if there are any changes in Rx queue, the NIC driver needs to stop the Rx queue by unregistering with XDP before purging and reallocating memory. Drop page_pool destroy during Rx channel reset as this is already handled by XDP during xdp_rxq_info_unreg (Rx queue unregister), failing to do will cause the following warning: warning logs: https://gist.github.com/MeghanaMalladiTI/eb627e5dc8de24e42d7d46572c13e576 Fixes: 46eeb90f03e0 ("net: ti: icssg-prueth: Use page_pool API for RX buffer allocation") Signed-off-by: Meghana Malladi Reviewed-by: Simon Horman --- Changes from v1(v2-v1): - Included more trace logs for the warning - Collected RB tag from Simon Horman drivers/net/ethernet/ti/icssg/icssg_common.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/net/ethernet/ti/icssg/icssg_common.c b/drivers/net/ethernet/ti/icssg/icssg_common.c index df5da7a98abf..afa01c22dee8 100644 --- a/drivers/net/ethernet/ti/icssg/icssg_common.c +++ b/drivers/net/ethernet/ti/icssg/icssg_common.c @@ -1216,9 +1216,6 @@ void prueth_reset_rx_chan(struct prueth_rx_chn *chn, prueth_rx_cleanup, !!i); if (disable) k3_udma_glue_disable_rx_chn(chn->rx_chn); - - page_pool_destroy(chn->pg_pool); - chn->pg_pool = NULL; } EXPORT_SYMBOL_GPL(prueth_reset_rx_chan); From patchwork Fri Mar 21 08:13:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Malladi, Meghana" X-Patchwork-Id: 14024979 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A40ADC35FF3 for ; Fri, 21 Mar 2025 08:19:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=1QRNK+uPPm6yb6KBM5lbIV1SyTZ1Gd9sAIkbavrbAec=; b=GmSgruhn5/cxGZm+tBlwumCJuM aFU5R2LHLY6rU/vNjwIb6uVC1DIUFCkIajL8Qv8mj8iE4SsdlPxLEhC2nRVm9nqpqXPZbZhHWV0R4 8Bg4WHDY6725gQZNq3vCgu8RXVd8cYeDSq+pkS79ysqUVwx+z7I6GypsqGUXDJHpl/AyDVyrGUDeE VBWhmzZDG//leiDvpMHDfXqoke44IrCqZ/dR/j/Ulam9hm2BmPIQ7NxiKA5F0hmJ5a+kK8tfNjNCY bBGAEluCeOHyZX7JK/wX1TryUtXNOH0UXmK32SbwD2Nb0H91BOqld8AdDzq+L1SVeC2qS+zp7U4ON VBamWmcw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tvXbQ-0000000EEmv-1Xn9; Fri, 21 Mar 2025 08:19:40 +0000 Received: from lelvem-ot02.ext.ti.com ([198.47.23.235]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tvXVj-0000000EDWW-1B4D for linux-arm-kernel@lists.infradead.org; Fri, 21 Mar 2025 08:13:48 +0000 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelvem-ot02.ext.ti.com (8.15.2/8.15.2) with ESMTPS id 52L8DPbG855093 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Mar 2025 03:13:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1742544805; bh=1QRNK+uPPm6yb6KBM5lbIV1SyTZ1Gd9sAIkbavrbAec=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=sto7GVEJouptHh6GN3t6GCGUgDh+g46IXFvmSmtOvryCGGvtNFAw5OG7rR6LyJ5Lm v6davIjJ1lDWvt0XRjj9UNuAxldmgVFwO4zXMH32TZCvSuz2JqpDmjApSaIk60oyi/ xx1bStAQykHr80s816v6Irmu5OW7qUe4kB+mW16w= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 52L8DPCs119303 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 21 Mar 2025 03:13:25 -0500 Received: from DFLE101.ent.ti.com (10.64.6.22) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Fri, 21 Mar 2025 03:13:24 -0500 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DFLE101.ent.ti.com (10.64.6.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Fri, 21 Mar 2025 03:13:24 -0500 Received: from lelv0854.itg.ti.com (lelv0854.itg.ti.com [10.181.64.140]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 52L8DOEl092783; Fri, 21 Mar 2025 03:13:24 -0500 Received: from localhost (meghana-pc.dhcp.ti.com [10.24.69.13] (may be forged)) by lelv0854.itg.ti.com (8.14.7/8.14.7) with ESMTP id 52L8DNXE032434; Fri, 21 Mar 2025 03:13:24 -0500 From: Meghana Malladi To: , , , , CC: , , , , , , , , , , , , , , , , Vignesh Raghavendra , Roger Quadros , Subject: [PATCH net-next v2 2/3] net: ti: prueth: Fix possible NULL pointer dereference inside emac_xmit_xdp_frame() Date: Fri, 21 Mar 2025 13:43:12 +0530 Message-ID: <20250321081313.37112-3-m-malladi@ti.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250321081313.37112-1-m-malladi@ti.com> References: <20250321081313.37112-1-m-malladi@ti.com> MIME-Version: 1.0 X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250321_011347_410366_9DBA5B8C X-CRM114-Status: GOOD ( 15.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org There is an error check inside emac_xmit_xdp_frame() function which is called when the driver wants to transmit XDP frame, to check if the allocated tx descriptor is NULL, if true to exit and return ICSSG_XDP_CONSUMED implying failure in transmission. In this case trying to free a descriptor which is NULL will result in kernel crash due to NULL pointer dereference. Fix this error handling and increase netdev tx_dropped stats in the caller of this function if the function returns ICSSG_XDP_CONSUMED. Fixes: 62aa3246f462 ("net: ti: icssg-prueth: Add XDP support") Signed-off-by: Meghana Malladi Reviewed-by: Simon Horman --- Changes from v1(v2-v1): - Collected RB tag from Simon Horman drivers/net/ethernet/ti/icssg/icssg_common.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/ti/icssg/icssg_common.c b/drivers/net/ethernet/ti/icssg/icssg_common.c index afa01c22dee8..f0224576b95f 100644 --- a/drivers/net/ethernet/ti/icssg/icssg_common.c +++ b/drivers/net/ethernet/ti/icssg/icssg_common.c @@ -584,7 +584,7 @@ u32 emac_xmit_xdp_frame(struct prueth_emac *emac, first_desc = k3_cppi_desc_pool_alloc(tx_chn->desc_pool); if (!first_desc) { netdev_dbg(ndev, "xdp tx: failed to allocate descriptor\n"); - goto drop_free_descs; /* drop */ + return ICSSG_XDP_CONSUMED; /* drop */ } if (page) { /* already DMA mapped by page_pool */ @@ -672,8 +672,10 @@ static u32 emac_run_xdp(struct prueth_emac *emac, struct xdp_buff *xdp, q_idx = smp_processor_id() % emac->tx_ch_num; result = emac_xmit_xdp_frame(emac, xdpf, page, q_idx); - if (result == ICSSG_XDP_CONSUMED) + if (result == ICSSG_XDP_CONSUMED) { + ndev->stats.tx_dropped++; goto drop; + } dev_sw_netstats_rx_add(ndev, xdpf->len); return result; From patchwork Fri Mar 21 08:13:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Malladi, Meghana" X-Patchwork-Id: 14024980 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 74F81C35FF3 for ; Fri, 21 Mar 2025 08:21:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=zBkFyFej/LjUcEirj4ZJVbw1Q5NfS6rUgggc1XPBP10=; b=uroUE5A5qp4EcFlGWZ+EbNbIX3 Ddm+GyU61BZIXF1C1pzf7rRx84MpGmtmLf1I8ttdXybheq5UBJOhrHzoLf/bh8Jno+TR7MK1nYcm0 8+xAehu682EnNX1yjdi8PpSQjjQ9seXoSkskxkIazaE3eRsVstuIxsner69KCpZmaj7Uehw7t5zNA gdUHYbsA8e+/RWiwuNM8IJflmvD8sh7UJ4yt2O0Gta+hKoct214auua+MzU6O2LU5Wb6RI3X2WqyR VBTWZ5AH0daZDqiFI28gaHrY34Q83XkuTffphld+I++iHTA7tbWoqa3Ia15dr7NF9h2yxN1BevVA6 ZFpT4x3w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tvXd4-0000000EF09-057J; Fri, 21 Mar 2025 08:21:22 +0000 Received: from fllvem-ot03.ext.ti.com ([198.47.19.245]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tvXVk-0000000EDWr-0Wpz for linux-arm-kernel@lists.infradead.org; Fri, 21 Mar 2025 08:13:49 +0000 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllvem-ot03.ext.ti.com (8.15.2/8.15.2) with ESMTPS id 52L8DSub262220 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 21 Mar 2025 03:13:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1742544808; bh=zBkFyFej/LjUcEirj4ZJVbw1Q5NfS6rUgggc1XPBP10=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Ss5XFq8LA0mUPPXeTRbGotDm6AdtwmosmwCG78Ii6kaD27XwhznnIYw8cVOGAJai0 R41m/8h7bQYy2ZkQEDEZtHOKNDy27ikNZDCJpob/7VBZC8HcsbNAeT6gze6wdXOtQY 51FxIdjWVmhBi2M+vQM5DI493skyDJclkwtYuZ2k= Received: from DLEE107.ent.ti.com (dlee107.ent.ti.com [157.170.170.37]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTP id 52L8DSl1127629; Fri, 21 Mar 2025 03:13:28 -0500 Received: from DLEE105.ent.ti.com (157.170.170.35) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Fri, 21 Mar 2025 03:13:28 -0500 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Fri, 21 Mar 2025 03:13:28 -0500 Received: from lelv0854.itg.ti.com (lelv0854.itg.ti.com [10.181.64.140]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 52L8DShA130300; Fri, 21 Mar 2025 03:13:28 -0500 Received: from localhost (meghana-pc.dhcp.ti.com [10.24.69.13] (may be forged)) by lelv0854.itg.ti.com (8.14.7/8.14.7) with ESMTP id 52L8DQSt032443; Fri, 21 Mar 2025 03:13:27 -0500 From: Meghana Malladi To: , , , , CC: , , , , , , , , , , , , , , , , Vignesh Raghavendra , Roger Quadros , Subject: [PATCH net-next v2 3/3] net: ti: icss-iep: Fix possible NULL pointer dereference for perout request Date: Fri, 21 Mar 2025 13:43:13 +0530 Message-ID: <20250321081313.37112-4-m-malladi@ti.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250321081313.37112-1-m-malladi@ti.com> References: <20250321081313.37112-1-m-malladi@ti.com> MIME-Version: 1.0 X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250321_011348_255979_F5AF23CE X-CRM114-Status: GOOD ( 13.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Whenever there is a perout request from the user application, kernel receives req structure containing the configuration info for that req. Add NULL pointer handling for perout request if that req struct points to NULL. Fixes: e5b456a14215 ("net: ti: icss-iep: Add pwidth configuration for perout signal") Signed-off-by: Meghana Malladi Reviewed-by: Simon Horman --- Changes from v1(v2-v1): - Collected RB tag from Simon Horman drivers/net/ethernet/ti/icssg/icss_iep.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/ti/icssg/icss_iep.c b/drivers/net/ethernet/ti/icssg/icss_iep.c index b4a34c57b7b4..aeebdc4c121e 100644 --- a/drivers/net/ethernet/ti/icssg/icss_iep.c +++ b/drivers/net/ethernet/ti/icssg/icss_iep.c @@ -498,6 +498,10 @@ static int icss_iep_perout_enable(struct icss_iep *iep, { int ret = 0; + /* Return error if the req is NULL */ + if (!req) + return -EINVAL; + /* Reject requests with unsupported flags */ if (req->flags & ~(PTP_PEROUT_DUTY_CYCLE | PTP_PEROUT_PHASE))