Commit fadd3f8a authored by Conrad Meyer's avatar Conrad Meyer
Browse files

pci_ioctl: Avoid returning uninitialized error value if user provided empty buffer

In the weird case where the user-provided buffer was zero bytes, we could break
out of PCIOCGETCONF and return without initializing error.  In this case,
initialize error to zero -- we successfully did nothing, as requested.

Reported by:	Coverity
Sponsored by:	Dell EMC Isilon
parent 893daee6
......@@ -762,8 +762,10 @@ pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *t
* tell the user that there are more matches
* left.
if (cio->num_matches >= ionum)
if (cio->num_matches >= ionum) {
error = 0;
#ifdef PRE7_COMPAT
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment