]> git.baikalelectronics.ru Git - kernel.git/commit
[BLUETOOTH]: Use sockfd_put()
authorJulia Lawall <julia@diku.dk>
Tue, 8 Jan 2008 06:38:42 +0000 (22:38 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 23:00:48 +0000 (15:00 -0800)
commit23362ea036770bb07e720d58fab482878832c628
treec02e09a072d3461505033374e1026000abe2b753
parentdeee128e8ef401ebdd0ef3753def0630527fe630
[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>
net/bluetooth/bnep/sock.c
net/bluetooth/cmtp/sock.c
net/bluetooth/hidp/sock.c