platform: drop unnecessary check in _vlan_xgress_qos_mappings_cpy()

For one, "src_n_map" must always be greater than zero at this point.
lgtm.com warns about that, and the point of this patch is to avoid
that warning.

Still, the check really isn't needed, also because nm_memdup() explicitly
handles buffers sizes of zero.
This commit is contained in:
Thomas Haller 2021-05-27 09:04:58 +02:00
parent 90818b5391
commit f903d3b7b8
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -540,8 +540,7 @@ _vlan_xgress_qos_mappings_cpy(guint * dst_n_map,
|| _vlan_xgress_qos_mappings_cmp(src_n_map, *dst_map, src_map) != 0) {
nm_clear_g_free(dst_map);
*dst_n_map = src_n_map;
if (src_n_map > 0)
*dst_map = nm_memdup(src_map, sizeof(*src_map) * src_n_map);
*dst_map = nm_memdup(src_map, sizeof(*src_map) * src_n_map);
}
}