Netdev List
 help / color / mirror / Atom feed
* question about drivers/isdn/hisax/st5481_init.c
@ 2011-05-13  5:53 Julia Lawall
  2011-05-13 13:20 ` Ben Hutchings
  0 siblings, 1 reply; 3+ messages in thread
From: Julia Lawall @ 2011-05-13  5:53 UTC (permalink / raw)
  To: Karsten Keil, netdev, linux-kernel

The function probe_st5481 allocates an adapter value using kzalloc, adds 
it to adapter_list, and then performs various initialization operations, 
which may fail.  adapter_list is a static variable that is never otherwise 
referenced in the file.  There is a list_del that removes the adapter from 
the list in the function disconnect_st5481.  The presence of the adapter 
on the list makes it possibly unsafe to free adapter in the failure cases.

Could the list just be removed, if it is not being used anywhere?

Or if the list should be kept because it is useful or it is planned to be 
useful in the future, could the insertion into the list be moved to the 
end of the function, after the potentially failing operations, so that 
adapter can be freed when a failure occurs?

julia

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-05-13 13:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-13  5:53 question about drivers/isdn/hisax/st5481_init.c Julia Lawall
2011-05-13 13:20 ` Ben Hutchings
2011-05-13 13:35   ` Julia Lawall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox