question about net/sctp/socket.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Networking Development]     [Linux OMAP]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux