Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 27a2234e authored by Christian Engelmayer's avatar Christian Engelmayer Committed by Greg Kroah-Hartman
Browse files

staging: comedi: ii_pci20kc: fix usage of uninit scalar in ii20k_attach()



This driver supports the PCI-20001C-1a and PCI-20001C-2a carrier boards.
The -2a version has 32 on-board DIO channels. In case this variant is
detected, local variable 'has_dio' is set accordingly. Otherwise it is
left uninitialized and the following subdevice instantiation depends on
the stack. Detected by Coverity - CID 1077830.

Signed-off-by: default avatarChristian Engelmayer <cengelma@gmx.at>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 55292b3d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -461,6 +461,7 @@ static int ii20k_attach(struct comedi_device *dev,
	id = readb(devpriv->ioaddr + II20K_ID_REG);
	switch (id & II20K_ID_MASK) {
	case II20K_ID_PCI20001C_1A:
		has_dio = false;
		break;
	case II20K_ID_PCI20001C_2A:
		has_dio = true;