From: Johannes Berg Date: Thu, 21 Feb 2008 13:09:30 +0000 (+0100) Subject: mac80211: atomically check whether STA exists already X-Git-Tag: v2.6.26-rc1~1138^2~530^2~15 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=43ba7e958f2ca05e4e9171a15402288419289d71;p=pandora-kernel.git mac80211: atomically check whether STA exists already When a STA structure is added, it is often checked whether it already exists before adding it. This, however, isn't done atomically so there is a race condition that could lead to two STA structures being added with the same MAC address. This patch changes sta_info_add() to return an ERR_PTR in case of failure and adds the failure mode -EEXIST when the STA already exists. Signed-off-by: Johannes Berg Cc: Luis Carlos Cobo Signed-off-by: John W. Linville --- Reading git-diff-tree failed