potential problem in au1000_generic.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I found a potential probelm in au1x00_pcmcia_socket_probe().

This function roughly looks like:

int au1x00_pcmcia_socket_probe(struct device *dev, struct pcmcia_low_level *ops, int first, int nr)
{
...
	for (i = 0; i < nr; i++) {
		struct au1000_pcmcia_socket *skt = PCMCIA_SOCKET(i);
...
		ret = pcmcia_register_socket(&skt->socket);
		if (ret)
			goto out_err;
...
	}
...
	return 0;

	do {
		struct au1000_pcmcia_socket *skt = PCMCIA_SOCKET(i);
...
out_err:
...
		ops->hw_shutdown(skt);
		i--;
	} while (i > 0);
...
}

The 'out_err' path seems broken since 'skt' in for-loop and
do-while-loop are another variable.  The local variable 'skt' should
be declared outside those loop.

---
Atsushi Nemoto


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux