Commit 30720585 authored by Alejandro Homs Puron's avatar Alejandro Homs Puron
Browse files

[NETDEV_SET_QUEUE_CPU_AFFINITY] Improve error checking from snprintf

parent 21b1ccb3
......@@ -31,7 +31,7 @@ int main(int argc, char *argv[])
else
ret = snprintf(fname, len, "/sys/class/net/%s/queues/%s/rps_cpus",
dev, irq_queue);
if ((ret < 0) || (ret == len))
if ((ret < 0) || (ret >= len))
exit(3);
fd = open(fname, O_WRONLY);
......
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