Re: [PATCH 2/2] PCI: endpoint: pci-epf-ntb: Add check to detect 'db_count' value of 0
From: Krzysztof Wilczyński
Date: Tue May 12 2026 - 01:42:05 EST
Hello,
> @@ -1297,12 +1300,12 @@ static int epf_ntb_configure_interrupt(struct epf_ntb *ntb,
> vfunc_no = ntb_epc->vfunc_no;
>
> db_count = ntb->db_count;
> - if (db_count > MAX_DB_COUNT) {
> - dev_err(dev, "DB count cannot be more than %d\n", MAX_DB_COUNT);
> + if (!db_count || db_count > MAX_DB_COUNT) {
> + dev_err(dev, "DB count %d out of range (1 - %d)\n",
> + db_count, MAX_DB_COUNT);
> return -EINVAL;
> }
Something that I was wondering about here: would it make sense to also
remove this variable from here, too? Even though it's referenced below
here (which is why I think you left it here). Thoughts?
Thank you!
Krzysztof