From: Karel Zak Date: Wed, 15 May 2019 15:46:31 +0000 (+0200) Subject: libsmartcols: (groups) improve scols_table_group_lines() args check [coverity scan] X-Git-Tag: v2.34-rc2~61 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e2a0f2634151c36e7dd229db31ee54933bcf28d1;p=thirdparty%2Futil-linux.git libsmartcols: (groups) improve scols_table_group_lines() args check [coverity scan] Signed-off-by: Karel Zak --- diff --git a/libsmartcols/src/grouping.c b/libsmartcols/src/grouping.c index 0e4851e30b..43376fdc79 100644 --- a/libsmartcols/src/grouping.c +++ b/libsmartcols/src/grouping.c @@ -495,11 +495,11 @@ int scols_table_group_lines( struct libscols_table *tb, { struct libscols_group *gr = NULL; - if (!tb || (!ln && !member)) { - DBG(GROUP, ul_debugobj(gr, "failed group lines (no table, line or member)")); + if (!tb || !member) { + DBG(GROUP, ul_debugobj(gr, "failed group lines (no table or member)")); return -EINVAL; } - if (ln && member) { + if (ln) { if (ln->group && !member->group) { DBG(GROUP, ul_debugobj(gr, "failed group lines (new group, line member of another)")); return -EINVAL;