mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-19 06:47:02 -04:00
Merge branch 'fanalyzer-fix' into 'master'
GCC static analyzer misc fixes See merge request wlroots/wlroots!4637
This commit is contained in:
commit
52730a2f1e
17 changed files with 57 additions and 6 deletions
|
|
@ -260,6 +260,8 @@ static struct wlr_backend *attempt_drm_backend(struct wlr_backend *backend, stru
|
|||
for (size_t i = 0; i < (size_t)num_gpus; ++i) {
|
||||
struct wlr_backend *drm = wlr_drm_backend_create(session, gpus[i], primary_drm);
|
||||
if (!drm) {
|
||||
wlr_session_close_file(session, gpus[i]);
|
||||
|
||||
wlr_log(WLR_ERROR, "Failed to create DRM backend");
|
||||
continue;
|
||||
}
|
||||
|
|
@ -270,6 +272,7 @@ static struct wlr_backend *attempt_drm_backend(struct wlr_backend *backend, stru
|
|||
|
||||
wlr_multi_backend_add(backend, drm);
|
||||
}
|
||||
|
||||
if (!primary_drm) {
|
||||
wlr_log(WLR_ERROR, "Could not successfully create backend on any GPU");
|
||||
return NULL;
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ static void add_pad_group_from_libinput(struct wlr_tablet_pad *pad,
|
|||
size_t ring = 0;
|
||||
for (size_t i = 0; i < pad->ring_count; ++i) {
|
||||
if (libinput_tablet_pad_mode_group_has_ring(li_group, i)) {
|
||||
assert(ring < group->ring_count);
|
||||
group->rings[ring++] = i;
|
||||
}
|
||||
}
|
||||
|
|
@ -53,9 +54,11 @@ static void add_pad_group_from_libinput(struct wlr_tablet_pad *pad,
|
|||
if (group->strips == NULL) {
|
||||
goto group_fail;
|
||||
}
|
||||
|
||||
size_t strip = 0;
|
||||
for (size_t i = 0; i < pad->strip_count; ++i) {
|
||||
if (libinput_tablet_pad_mode_group_has_strip(li_group, i)) {
|
||||
assert(strip < group->strip_count);
|
||||
group->strips[strip++] = i;
|
||||
}
|
||||
}
|
||||
|
|
@ -69,9 +72,11 @@ static void add_pad_group_from_libinput(struct wlr_tablet_pad *pad,
|
|||
if (group->buttons == NULL) {
|
||||
goto group_fail;
|
||||
}
|
||||
|
||||
size_t button = 0;
|
||||
for (size_t i = 0; i < pad->button_count; ++i) {
|
||||
if (libinput_tablet_pad_mode_group_has_button(li_group, i)) {
|
||||
assert(button < group->button_count);
|
||||
group->buttons[button++] = i;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -402,11 +402,11 @@ static ssize_t explicit_find_gpus(struct wlr_session *session,
|
|||
break;
|
||||
}
|
||||
|
||||
ret[i] = session_open_if_kms(session, ptr);
|
||||
if (!ret[i]) {
|
||||
wlr_log(WLR_ERROR, "Unable to open %s as DRM device", ptr);
|
||||
struct wlr_device *dev = session_open_if_kms(session, ptr);
|
||||
if (dev) {
|
||||
ret[i++] = dev;
|
||||
} else {
|
||||
++i;
|
||||
wlr_log(WLR_ERROR, "Unable to open %s as DRM device", ptr);
|
||||
}
|
||||
} while ((ptr = strtok_r(NULL, ":", &save)));
|
||||
|
||||
|
|
|
|||
|
|
@ -184,7 +184,7 @@ static void handle_tablet_pad_group_buttons(void *data,
|
|||
struct tablet_pad_group *group = data;
|
||||
|
||||
free(group->group.buttons);
|
||||
group->group.buttons = calloc(1, buttons->size);
|
||||
group->group.buttons = malloc(buttons->size);
|
||||
if (!group->group.buttons) {
|
||||
// FIXME: Add actual error handling
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue