Skip to contentSkip to conversation

cx23885: fix uninitialized variable warning

PATCH New Hans Verkuil 1 participant 1 message Nov 3, 2014 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cx23885: fix uninitialized variable warning

cx23885-dvb.c: In function 'cx23885_sp2_ci_ctrl':
cx23885-dvb.c:675:13: warning: 'tmp' may be used uninitialized in this function [-Wmaybe-uninitialized]

  *mem = tmp & 0xff;
             ^
drivers/media/pci/cx23885/cx23885-dvb.c +1 -1
index 7578549..577d2e9 100644
@@ -635,7 +635,7 @@ static int cx23885_sp2_ci_ctrl(void *priv, u8 read, int addr,
 	struct cx23885_tsport *port = priv;
 	struct cx23885_dev *dev = port->dev;
 	int ret;
-	int tmp;
+	int tmp = 0;
 	unsigned long timeout;
 
 	mutex_lock(&dev->gpio_lock);