Subject: potential problem in au1000_generic.c

From: Atsushi Nemoto <[email-masked]>
Date: Tue, 13 Sep 2005 10:49:11 +0900 (JST)

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