File: 1110-xhfc_lastreg.patch

package info (click to toggle)
dahdi-linux 1%3A3.1.0%2Bgit20230717~dfsg-10.1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 8,668 kB
  • sloc: ansic: 116,367; perl: 2,391; sh: 1,157; makefile: 423; xml: 24
file content (18 lines) | stat: -rw-r--r-- 714 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
From: Tzafrir Cohen <tzafrir@debian.org>
Subject: Initialize x in xhfc.c

Reported error of uninitialized variabld x.
Initialize it to the same value used to initialize the field lastreg.

Index: dahdi-linux/drivers/dahdi/wctdm24xxp/xhfc.c
===================================================================
--- dahdi-linux.orig/drivers/dahdi/wctdm24xxp/xhfc.c	2023-07-29 02:48:26.143471359 +0530
+++ dahdi-linux/drivers/dahdi/wctdm24xxp/xhfc.c	2023-09-07 11:36:44.951994331 +0530
@@ -2559,6 +2559,7 @@
 	unsigned long flags;
 	int chiprev;
 
+	x = 0xff; /* a register we won't hit right off the bat */
 	wctdm_setreg(wc, &wc->mods[modpos], 0x10, 0x10);
 	id = xhfc_getreg(wc, &wc->mods[modpos], R_CHIP_ID, &x);