Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
09aaacf0
Commit
09aaacf0
authored
Mar 05, 2014
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vhost: don't open-code sockfd_put()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
964ea96e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
drivers/vhost/net.c
drivers/vhost/net.c
+7
-7
No files found.
drivers/vhost/net.c
View file @
09aaacf0
...
@@ -818,9 +818,9 @@ static int vhost_net_release(struct inode *inode, struct file *f)
...
@@ -818,9 +818,9 @@ static int vhost_net_release(struct inode *inode, struct file *f)
vhost_dev_cleanup
(
&
n
->
dev
,
false
);
vhost_dev_cleanup
(
&
n
->
dev
,
false
);
vhost_net_vq_reset
(
n
);
vhost_net_vq_reset
(
n
);
if
(
tx_sock
)
if
(
tx_sock
)
fput
(
tx_sock
->
file
);
sockfd_put
(
tx_sock
);
if
(
rx_sock
)
if
(
rx_sock
)
fput
(
rx_sock
->
file
);
sockfd_put
(
rx_sock
);
/* Make sure no callbacks are outstanding */
/* Make sure no callbacks are outstanding */
synchronize_rcu_bh
();
synchronize_rcu_bh
();
/* We do an extra flush before freeing memory,
/* We do an extra flush before freeing memory,
...
@@ -860,7 +860,7 @@ static struct socket *get_raw_socket(int fd)
...
@@ -860,7 +860,7 @@ static struct socket *get_raw_socket(int fd)
}
}
return
sock
;
return
sock
;
err:
err:
fput
(
sock
->
file
);
sockfd_put
(
sock
);
return
ERR_PTR
(
r
);
return
ERR_PTR
(
r
);
}
}
...
@@ -966,7 +966,7 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd)
...
@@ -966,7 +966,7 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd)
if
(
oldsock
)
{
if
(
oldsock
)
{
vhost_net_flush_vq
(
n
,
index
);
vhost_net_flush_vq
(
n
,
index
);
fput
(
oldsock
->
file
);
sockfd_put
(
oldsock
);
}
}
mutex_unlock
(
&
n
->
dev
.
mutex
);
mutex_unlock
(
&
n
->
dev
.
mutex
);
...
@@ -978,7 +978,7 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd)
...
@@ -978,7 +978,7 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd)
if
(
ubufs
)
if
(
ubufs
)
vhost_net_ubuf_put_wait_and_free
(
ubufs
);
vhost_net_ubuf_put_wait_and_free
(
ubufs
);
err_ubufs:
err_ubufs:
fput
(
sock
->
file
);
sockfd_put
(
sock
);
err_vq:
err_vq:
mutex_unlock
(
&
vq
->
mutex
);
mutex_unlock
(
&
vq
->
mutex
);
err:
err:
...
@@ -1009,9 +1009,9 @@ static long vhost_net_reset_owner(struct vhost_net *n)
...
@@ -1009,9 +1009,9 @@ static long vhost_net_reset_owner(struct vhost_net *n)
done:
done:
mutex_unlock
(
&
n
->
dev
.
mutex
);
mutex_unlock
(
&
n
->
dev
.
mutex
);
if
(
tx_sock
)
if
(
tx_sock
)
fput
(
tx_sock
->
file
);
sockfd_put
(
tx_sock
);
if
(
rx_sock
)
if
(
rx_sock
)
fput
(
rx_sock
->
file
);
sockfd_put
(
rx_sock
);
return
err
;
return
err
;
}
}
...
...
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