DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/ice: fix wrong DDP search path
@ 2024-11-01  8:44 Zhichao Zeng
  2024-11-01  9:36 ` Bruce Richardson
  2024-11-04 10:09 ` [PATCH v2] " Zhichao Zeng
  0 siblings, 2 replies; 6+ messages in thread
From: Zhichao Zeng @ 2024-11-01  8:44 UTC (permalink / raw)
  To: dev; +Cc: Zhichao Zeng, Bruce Richardson, Anatoly Burakov

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 <zhichaox.zeng@intel.com>
---
 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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-11-05  2:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-01  8:44 [PATCH] net/ice: fix wrong DDP search path Zhichao Zeng
2024-11-01  9:36 ` Bruce Richardson
2024-11-04  9:57   ` Zeng, ZhichaoX
2024-11-04 10:09 ` [PATCH v2] " Zhichao Zeng
2024-11-04 14:32   ` Bruce Richardson
2024-11-05  2:41   ` Li, HongboX

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).