diff --git a/patches.suse/watchdog-pcwd_usb-Fix-attempting-to-access-uninitial.patch b/patches.suse/watchdog-pcwd_usb-Fix-attempting-to-access-uninitial.patch new file mode 100644 index 0000000..20eea61 --- /dev/null +++ b/patches.suse/watchdog-pcwd_usb-Fix-attempting-to-access-uninitial.patch @@ -0,0 +1,64 @@ +From 7d06c07c67100fd0f8e6b3ab7145ce789f788117 Mon Sep 17 00:00:00 2001 +From: Li Hua +Date: Wed, 16 Nov 2022 10:07:06 +0800 +Subject: [PATCH] watchdog: pcwd_usb: Fix attempting to access uninitialized + memory +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Git-commit: 7d06c07c67100fd0f8e6b3ab7145ce789f788117 +References: git-fixes +Patch-mainline: v6.3-rc1 + +The stack variable msb and lsb may be used uninitialized in function +usb_pcwd_get_temperature and usb_pcwd_get_timeleft when usb card no response. + +The build waring is: +drivers/watchdog/pcwd_usb.c:336:22: error: ‘lsb’ is used uninitialized in this function [-Werror=uninitialized] + *temperature = (lsb * 9 / 5) + 32; + ~~~~^~~ +drivers/watchdog/pcwd_usb.c:328:21: note: ‘lsb’ was declared here + unsigned char msb, lsb; + ^~~ +cc1: all warnings being treated as errors +scripts/Makefile.build:250: recipe for target 'drivers/watchdog/pcwd_usb.o' failed +make[3]: *** [drivers/watchdog/pcwd_usb.o] Error 1 + +Fixes: b7e04f8c61a4 ("mv watchdog tree under drivers") +Signed-off-by: Li Hua +Reviewed-by: Guenter Roeck +Link: https://lore.kernel.org/r/20221116020706.70847-1-hucool.lihua@huawei.com +Signed-off-by: Guenter Roeck +Signed-off-by: Wim Van Sebroeck +Signed-off-by: Oliver Neukum +--- + drivers/watchdog/pcwd_usb.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/drivers/watchdog/pcwd_usb.c b/drivers/watchdog/pcwd_usb.c +index 1bdaf17c1d38..8202f0a6b093 100644 +--- a/drivers/watchdog/pcwd_usb.c ++++ b/drivers/watchdog/pcwd_usb.c +@@ -325,7 +325,8 @@ static int usb_pcwd_set_heartbeat(struct usb_pcwd_private *usb_pcwd, int t) + static int usb_pcwd_get_temperature(struct usb_pcwd_private *usb_pcwd, + int *temperature) + { +- unsigned char msb, lsb; ++ unsigned char msb = 0x00; ++ unsigned char lsb = 0x00; + + usb_pcwd_send_command(usb_pcwd, CMD_READ_TEMP, &msb, &lsb); + +@@ -341,7 +342,8 @@ static int usb_pcwd_get_temperature(struct usb_pcwd_private *usb_pcwd, + static int usb_pcwd_get_timeleft(struct usb_pcwd_private *usb_pcwd, + int *time_left) + { +- unsigned char msb, lsb; ++ unsigned char msb = 0x00; ++ unsigned char lsb = 0x00; + + /* Read the time that's left before rebooting */ + /* Note: if the board is not yet armed then we will read 0xFFFF */ +-- +2.40.0 + diff --git a/series.conf b/series.conf index 994a7fa..c98dc23 100644 --- a/series.conf +++ b/series.conf @@ -63177,6 +63177,7 @@ patches.suse/powerpc-rtas-ensure-4KB-alignment-for-rtas_data_buf.patch patches.suse/media-platform-ti-Add-missing-check-for-devm_regulat.patch patches.suse/media-rc-Fix-use-after-free-bugs-caused-by-ene_tx_ir.patch + patches.suse/watchdog-pcwd_usb-Fix-attempting-to-access-uninitial.patch patches.suse/net-usb-qmi_wwan-add-Telit-0x1080-composition.patch patches.suse/SUNRPC-Fix-a-server-shutdown-leak.patch patches.suse/scsi-qla2xxx-Add-option-to-disable-FC2-Target-suppor.patch