Skip to contentSkip to conversation

ncsi: Support sparse package ids in ncsi_write_package_info

PATCH New James Lamanna 1 participant 1 message Aug 20, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ncsi: Support sparse package ids in ncsi_write_package_info

For platforms with sparse package ids, where package_num < max(package_id)-1, a check against package_num would prevent the return of package info.

This removes that check as it breaks these platforms and is an incorrect comparison (package_id vs number of packages).

Invalid package_ids are checked in the following loop, and -ENODEV is still returned if there are no matches.

---
 net/ncsi/ncsi-netlink.c | 5 -----
 1 file changed, 5 deletions(-)
net/ncsi/ncsi-netlink.c +0 -5
index 2f872d064396..62fabcc000c9 100644
@@ -100,11 +100,6 @@ static int ncsi_write_package_info(struct sk_buff *skb,
 	bool found;
 	int rc;
 
-	if (id > ndp->package_num - 1) {
-		netdev_info(ndp->ndev.dev, "NCSI: No package with id %u\n", id);
-		return -ENODEV;
-	}
-
 	found = false;
 	NCSI_FOR_EACH_PACKAGE(ndp, np) {
 		if (np->id != id)
Signature · 1 line
2.34.1