summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/cmtp
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2008-01-08 07:38:42 +0100
committerDavid S. Miller <davem@davemloft.net>2008-01-29 00:00:48 +0100
commit67b23219ce2f78352b0c566a472ff16c1b0fea9a (patch)
treec02e09a072d3461505033374e1026000abe2b753 /net/bluetooth/cmtp
parent[NET]: Remove unused member of dst_entry (diff)
downloadlinux-67b23219ce2f78352b0c566a472ff16c1b0fea9a.tar.xz
linux-67b23219ce2f78352b0c566a472ff16c1b0fea9a.zip
[BLUETOOTH]: Use sockfd_put()
The function sockfd_lookup uses fget on the value that is stored in the file field of the returned structure, so fput should ultimately be applied to this value. This can be done directly, but it seems better to use the specific macro sockfd_put, which does the same thing. The problem was fixed using the following semantic patch. (http://www.emn.fr/x-info/coccinelle/) // <smpl> @@ expression s; @@ s = sockfd_lookup(...) ... + sockfd_put(s); ?- fput(s->file); // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bluetooth/cmtp')
-rw-r--r--net/bluetooth/cmtp/sock.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/bluetooth/cmtp/sock.c b/net/bluetooth/cmtp/sock.c
index 783edab12ce8..8c7f7bc4e0ba 100644
--- a/net/bluetooth/cmtp/sock.c
+++ b/net/bluetooth/cmtp/sock.c
@@ -88,7 +88,7 @@ static int cmtp_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long
return err;
if (nsock->sk->sk_state != BT_CONNECTED) {
- fput(nsock->file);
+ sockfd_put(nsock);
return -EBADFD;
}
@@ -97,7 +97,7 @@ static int cmtp_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long
if (copy_to_user(argp, &ca, sizeof(ca)))
err = -EFAULT;
} else
- fput(nsock->file);
+ sockfd_put(nsock);
return err;