Netdev List
 help / color / mirror / Atom feed
From: Julia Lawall <julia@diku.dk>
To: Karsten Keil <isdn@linux-pingi.de>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: question about drivers/isdn/hisax/st5481_init.c
Date: Fri, 13 May 2011 07:53:43 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.64.1105130748060.9190@ask.diku.dk> (raw)

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

             reply	other threads:[~2011-05-13  5:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-13  5:53 Julia Lawall [this message]
2011-05-13 13:20 ` question about drivers/isdn/hisax/st5481_init.c Ben Hutchings
2011-05-13 13:35   ` Julia Lawall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.1105130748060.9190@ask.diku.dk \
    --to=julia@diku.dk \
    --cc=isdn@linux-pingi.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox