Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
c4835d81
Commit
c4835d81
authored
Sep 10, 2009
by
Dmitry Eremin-Solenikov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ieee802154: add locking for seq numbers
Signed-off-by:
Dmitry Eremin-Solenikov
<
dbaryshkov@gmail.com
>
parent
066fc512
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
net/ieee802154/netlink.c
net/ieee802154/netlink.c
+4
-0
No files found.
net/ieee802154/netlink.c
View file @
c4835d81
...
...
@@ -35,6 +35,7 @@
#include <net/ieee802154_netdev.h>
static
unsigned
int
ieee802154_seq_num
;
static
DEFINE_SPINLOCK
(
ieee802154_seq_lock
);
static
struct
genl_family
ieee802154_coordinator_family
=
{
.
id
=
GENL_ID_GENERATE
,
...
...
@@ -57,12 +58,15 @@ static struct sk_buff *ieee802154_nl_create(int flags, u8 req)
{
void
*
hdr
;
struct
sk_buff
*
msg
=
nlmsg_new
(
NLMSG_GOODSIZE
,
GFP_ATOMIC
);
unsigned
long
f
;
if
(
!
msg
)
return
NULL
;
spin_lock_irqsave
(
&
ieee802154_seq_lock
,
f
);
hdr
=
genlmsg_put
(
msg
,
0
,
ieee802154_seq_num
++
,
&
ieee802154_coordinator_family
,
flags
,
req
);
spin_unlock_irqrestore
(
&
ieee802154_seq_lock
,
f
);
if
(
!
hdr
)
{
nlmsg_free
(
msg
);
return
NULL
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment