lkml.org 
[lkml]   [2006]   [Oct]   [6]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateFri, 6 Oct 2006 16:31:36 +0900
FromYoichi Yuasa <>
SubjectRe: [-mm PATCH] fixed PCMCIA au1000_generic.c
On Thu, 5 Oct 2006 23:18:44 -0700
"Om Narasimhan" <om.turyx@gmail.com> wrote:

> On 10/4/06, Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> wrote:
> > Hi,
> >
> Sorry for the late reply.
> > pcmcia-au1000_generic-fix.patch has a problem.
> > It needs more fix.
> > ops->shutdown(skt), skt is out of definition scope.
> 
> Is it so?
> After applying the patch, the code would look like,
> -----
> 
> 		skt->status = au1x00_pcmcia_skt_state(skt);
> 
> 		ret = pcmcia_register_socket(&skt->socket);
> 		if (ret)
> 			goto out_err;
> <snip>
> 
> out_err:
> 	flush_scheduled_work();
> 	ops->hw_shutdown(skt);
> 	while (i-- > 0) {
> 		struct au1000_pcmcia_socket *skt = PCMCIA_SOCKET(i);
> 		del_timer_sync(&skt->poll_timer);
> 		pcmcia_unregister_socket(&skt->socket);
> 		flush_scheduled_work();
> 		ops->hw_shutdown(skt);
> 		i--;
> 	}
> 	kfree(sinfo);
> -----
> The  first call to ops->shutdown(skt) would free the skt (of the
> function scope). The internal skt to the loop is a placeholder to call
> shutdown().
> Or did I miss any point?


	for (i = 0; i < nr; i++) {
		struct au1000_pcmcia_socket *skt = PCMCIA_SOCKET(i); <-- 1st skt definition
<snip>
		ret = pcmcia_register_socket(&skt->socket);
		if (ret)
			goto out_err;
		WARN_ON(skt->socket.sock != i);

		add_timer(&skt->poll_timer);
	}
<snip>
out_err:
	flush_scheduled_work();
	ops->hw_shutdown(skt); <-- skt undeclared
	while (i-- > 0) {
		struct au1000_pcmcia_socket *skt = PCMCIA_SOCKET(i); <-- 2nd skt definition
		del_timer_sync(&skt->poll_timer);
		pcmcia_unregister_socket(&skt->socket);
		flush_scheduled_work();
		ops->hw_shutdown(skt);
	}
Yoichi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-10-06 09:35    [from the cache]
©2003-2008