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 2CB4745C47; Fri, 1 Nov 2024 09:29:09 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EEF29402C3; Fri, 1 Nov 2024 09:29:08 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) by mails.dpdk.org (Postfix) with ESMTP id B361940264 for ; Fri, 1 Nov 2024 09:29:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730449748; x=1761985748; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=eZrXX2/j1FT5twalbERSMkOxIdZl64LKOPis5irk18E=; b=iVoL3oTwuDF0pRQaho0C4zHbGS69R230cOF99iErThi1kh+XAiogWtSC G40cxMta0dd9SVFzBhP80+q5Hu2qFc9+0aohRVBCDaWNvNcMHzYFljSYm Cp2ZmA5kQKnqAFy6usWQVosGEJEdP+3z1DLZmLU4dWWVxjt+WEa4PNRdH CVlFlbyfDfxHuvUSwfl4RwlRn8vOga8s/G3IlVjFgpIc/9O/JlAO5Z4D/ jHZXoMg5LCQTI5arD5ETqLcAnXb7ul23XhbMCMihcMYDgd4ym2l0IP7Ee jr92+Ufv6Gaun5kFf7egwMO4b+NhHuQBdP+ID8/JTvk97Ge5j63UzWqMf w==; X-CSE-ConnectionGUID: /n2mb8eAQVSfZyz66q1Ekw== X-CSE-MsgGUID: 8dv24ChzSka1ZOd0qZiGMg== X-IronPort-AV: E=McAfee;i="6700,10204,11242"; a="29630146" X-IronPort-AV: E=Sophos;i="6.11,249,1725346800"; d="scan'208";a="29630146" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2024 01:29:07 -0700 X-CSE-ConnectionGUID: MwERzJeeRMeoWV6QmZwwWg== X-CSE-MsgGUID: K0iAvzmfQYe4zV2oikDOqg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,249,1725346800"; d="scan'208";a="83020281" Received: from unknown (HELO zhichao-dpdk..) ([10.239.252.103]) by fmviesa008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2024 01:29:05 -0700 From: Zhichao Zeng To: dev@dpdk.org Cc: Zhichao Zeng , Bruce Richardson , Anatoly Burakov Subject: [PATCH] net/ice: fix wrong DDP search path Date: Fri, 1 Nov 2024 16:44:43 +0800 Message-Id: <20241101084443.850674-1-zhichaox.zeng@intel.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 In the previous implementation, when the user did not enter any value in "/sys/module/firmware_class/parameters/path", it would incorrectly search for DDP packages under "/". This commit fixes this issue. Fixes: 9207f93640a7 ("net/ice: support custom search path for DDP package") Signed-off-by: Zhichao Zeng --- drivers/net/ice/ice_ethdev.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index d5e94a6685..0705f8e961 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -1922,8 +1922,11 @@ static int ice_read_customized_path(char *pkg_file, uint16_t buff_len) return -EIO; } - if (pkg_file[n - 1] == '\n') + if (pkg_file[n - 1] == '\n') { n--; + if (n == 0) + return -EINVAL; + } pkg_file[n] = '\0'; -- 2.34.1