Linux wireless drivers development
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: greearb@candelatech.com
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH] wireless: Allow registering more than one beacon listener.
Date: Fri, 26 Oct 2012 23:24:43 +0200	[thread overview]
Message-ID: <1351286683.10813.26.camel@jlt4.sipsolutions.net> (raw)
In-Reply-To: <1351286218-24838-1-git-send-email-greearb@candelatech.com> (sfid-20121026_231718_180820_DA67353D)

Thanks Ben,

A few small comments:

> +	nreg = kzalloc(sizeof(*nreg), GFP_KERNEL);

> +	memset(nreg, 0, sizeof(*nreg));

that memset isn't needed after kzalloc :)

> +	spin_lock_bh(&rdev->beacon_registrations_lock);
> +	list_for_each_entry(reg, &rdev->beacon_registrations, list) {
> +		msg = nlmsg_new(len + 100, gfp);

since you're in the locked section, you can't use "gfp" any more and
have to use GFP_ATOMIC, so we could even consider removing the gfp
argument to the function.


> +		hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_FRAME);
> +		if (!hdr) {
> +			spin_unlock_bh(&rdev->beacon_registrations_lock);
> +			nlmsg_free(msg);
> +			return;

it seems this should be some goto since nla_put_failure is also a label?


> +		spin_lock_bh(&rdev->beacon_registrations_lock);
> +		list_for_each_entry_safe(reg, tmp, &rdev->beacon_registrations,
> +					 list) {
> +			if (reg->nlportid == notify->portid) {
> +				list_del(&reg->list);
> +				kfree(reg);

You could break here, but it doesn't matter much.

johannes



      reply	other threads:[~2012-10-26 21:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-26 21:16 [PATCH] wireless: Allow registering more than one beacon listener greearb
2012-10-26 21:24 ` Johannes Berg [this message]

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=1351286683.10813.26.camel@jlt4.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=greearb@candelatech.com \
    --cc=linux-wireless@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