From 5bc4470a8ca01caf67e94752ae4e702c2e269af7 Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Thu, 20 Apr 2017 11:17:10 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20warning:=20=E2=80=98x=E2=80=99=20may=20be?= =?UTF-8?q?=20used=20uninitialized=20in=20this=20function?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Benjamin Tissoires --- src/libratbag-hidraw.c | 2 +- tools/hidpp10-dump-page.c | 2 +- tools/hidpp20-dump-page.c | 2 +- tools/ratbag-command.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libratbag-hidraw.c b/src/libratbag-hidraw.c index 61151948..b9df904c 100644 --- a/src/libratbag-hidraw.c +++ b/src/libratbag-hidraw.c @@ -1405,7 +1405,7 @@ ratbag_find_hidraw_node(struct ratbag_device *device, udev_enumerate_add_match_parent(e, parent_udev); udev_enumerate_scan_devices(e); udev_list_entry_foreach(entry, udev_enumerate_get_list_entry(e)) { - _cleanup_udev_device_unref_ struct udev_device *udev_device; + _cleanup_udev_device_unref_ struct udev_device *udev_device = NULL; path = udev_list_entry_get_name(entry); udev_device = udev_device_new_from_syspath(udev, path); diff --git a/tools/hidpp10-dump-page.c b/tools/hidpp10-dump-page.c index 332fcf1d..a497f8db 100644 --- a/tools/hidpp10-dump-page.c +++ b/tools/hidpp10-dump-page.c @@ -80,7 +80,7 @@ usage(void) int main(int argc, char **argv) { - _cleanup_close_ int fd; + _cleanup_close_ int fd = 0; const char *path; size_t page = 0, offset = 0; struct hidpp10_device *dev = NULL; diff --git a/tools/hidpp20-dump-page.c b/tools/hidpp20-dump-page.c index fddeda37..7140b118 100644 --- a/tools/hidpp20-dump-page.c +++ b/tools/hidpp20-dump-page.c @@ -92,7 +92,7 @@ usage(void) int main(int argc, char **argv) { - _cleanup_close_ int fd; + _cleanup_close_ int fd = 0; const char *path; size_t page = 0, offset = 0; struct hidpp20_device *dev = NULL; diff --git a/tools/ratbag-command.c b/tools/ratbag-command.c index baee1fa4..a4053537 100644 --- a/tools/ratbag-command.c +++ b/tools/ratbag-command.c @@ -605,7 +605,7 @@ ratbag_cmd_change_button(const struct ratbag_cmd *cmd, int button_index; enum ratbag_button_action_type action_type; int rc = ERR_DEVICE; - unsigned int btnkey; + unsigned int btnkey = 0; enum ratbag_button_action_special special; struct macro macro = {0};