driver-hidpp10: fix a coverity complaint
Coverity seems to think this can use uninitialized array elements but that can
only happen when hidpp10->dpi_count is 0. In which case the callee doesn't
touch it anyway but coverity doesn't care about that bit.
@@ -453,8 +453,8 @@ hidpp10drv_read_profile(struct ratbag_profile *profile)
/* FIXME: this relies on libratbag using the
* same steps that we support */
ratbag_resolution_set_dpi_list_from_range(res, min, max);
- } else {
- for (int i = 0; i < hidpp10->dpi_count; i++)
+ } else if (hidpp10->dpi_count > 0) {
+ for (uint8_t i = 0; i < hidpp10->dpi_count; i++)
dpis[i] = hidpp10->dpi_table[i].dpi;
ratbag_resolution_set_dpi_list(res, dpis, hidpp10->dpi_count);
