lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Mon, 19 Dec 2011 14:49:57 -0500 (EST)
From:	David Miller <davem@...emloft.net>
To:	alex.bluesman.smirnov@...il.com
Cc:	dbaryshkov@...il.com, linux-zigbee-devel@...ts.sourceforge.net,
	netdev@...r.kernel.org, alexander@...ovo
Subject: Re: [PATCH 13/14] drivers/ieee802154: IEEE 802.15.4 loopback driver

From: Alexander Smirnov <alex.bluesman.smirnov@...il.com>
Date: Mon, 19 Dec 2011 19:33:53 +0300

> +	unsigned int working:1;

Integer bit fields are troublesome, use a set of flags here, or if this
is likely to be the only set of state use a "bool" type.

> +		list_for_each_entry(dp, &priv->fake->list, list)
> +			if (dp != priv &&
> +			    dp->dev->phy->current_channel ==
> +					priv->dev->phy->current_channel)
> +				fakelb_hw_deliver(dp, skb);

Format the if() statement properly:

			if (dp != priv &&
			    (dp->dev->phy->current_channel ==
			     priv->dev->phy->current_channel))

And use braces around the top-level list traversal since the basic block is
taking up multiple lines.

> +static int
> +fakelb_hw_start(struct ieee802154_dev *dev) {
> +	struct fakelb_dev_priv *priv = dev->priv;
> +
> +	if (priv->working)
> +		return -EBUSY;
> +
> +	priv->working = 1;
> +
> +	return 0;
> +}

What prevents this "test and set" sequence from running in parallel with whatever
clears the ->working value and thus we end up losing the event?

> +	ieee->phy->channels_supported[6] |= 0x3ffc00;
> +
> +
> +	INIT_LIST_HEAD(&priv->list);

Excess empty line, there is no need for two of them, get rid of the
extra one.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ