All of lore.kernel.org
 help / color / mirror / Atom feed
* question about net/sctp/socket.c
@ 2012-04-02 13:24 Julia Lawall
  2012-04-02 13:49 ` Vladislav Yasevich
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Julia Lawall @ 2012-04-02 13:24 UTC (permalink / raw)
  To: linux-sctp

In the file net/sctp/socket.c, the function sctp_getsockopt_peeloff ends 
with:

        retval = sock_map_fd(newsock, 0);
         if (retval < 0) {
                 sock_release(newsock);
                 goto out;
         }

         SCTP_DEBUG_PRINTK("%s: sk: %p newsk: %p sd: %d\n",
                           __func__, sk, newsock->sk, retval);

         /* Return the fd mapped to the new socket.  */
         peeloff.sd = retval;
         if (put_user(len, optlen))
                 return -EFAULT;
         if (copy_to_user(optval, &peeloff, len))
                 retval = -EFAULT;

Should there be a call to sock_release in the final two error cases as 
well?  I don't see anything that removes the need for it.  And is some 
cleanup of the effect of sock_map_fd needed as well?

thanks,
julia

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-04-02 21:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-02 13:24 question about net/sctp/socket.c Julia Lawall
2012-04-02 13:49 ` Vladislav Yasevich
2012-04-02 14:59 ` Julia Lawall
2012-04-02 15:26 ` Vladislav Yasevich
2012-04-02 16:31 ` Julia Lawall
2012-04-02 18:19 ` Vladislav Yasevich
2012-04-02 21:01 ` Julia Lawall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.