[ovs-dev] [PATCH 3/6] dpctl: Skip invoking qsort on empty list
Bhanuprakash Bodireddy
bhanuprakash.bodireddy at intel.com
Mon Jun 19 18:54:01 UTC 2017
Clang reports "Argument with 'nonnull' attribute passed null" warning.
Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy at intel.com>
---
lib/dpctl.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/dpctl.c b/lib/dpctl.c
index 7f44d02..2ad475b 100644
--- a/lib/dpctl.c
+++ b/lib/dpctl.c
@@ -555,7 +555,9 @@ show_dpif(struct dpif *dpif, struct dpctl_params *dpctl_p)
n_port_nos++;
}
- qsort(port_nos, n_port_nos, sizeof *port_nos, compare_port_nos);
+ if (port_nos) {
+ qsort(port_nos, n_port_nos, sizeof *port_nos, compare_port_nos);
+ }
for (int i = 0; i < n_port_nos; i++) {
if (dpif_port_query_by_number(dpif, port_nos[i], &dpif_port)) {
--
2.4.11
More information about the dev
mailing list