ktime_t expires, *timeout = NULL;
struct timespec ts;
struct posix_msg_tree_node *new_leaf = NULL;
- int ret = 0;
+ int ret = 0, fput_needed;
if (u_abs_timeout) {
int res = prepare_timeout(u_abs_timeout, &expires, &ts);
audit_mq_sendrecv(mqdes, msg_len, msg_prio, timeout ? &ts : NULL);
- filp = fget(mqdes);
+ filp = fget_light(mqdes, &fput_needed);
if (unlikely(!filp)) {
ret = -EBADF;
goto out;
if (ret)
free_msg(msg_ptr);
out_fput:
- fput(filp);
+ fput_light(filp, fput_needed);
out:
return ret;
}
ktime_t expires, *timeout = NULL;
struct timespec ts;
struct posix_msg_tree_node *new_leaf = NULL;
+ int fput_needed;
if (u_abs_timeout) {
int res = prepare_timeout(u_abs_timeout, &expires, &ts);
audit_mq_sendrecv(mqdes, msg_len, 0, timeout ? &ts : NULL);
- filp = fget(mqdes);
+ filp = fget_light(mqdes, &fput_needed);
if (unlikely(!filp)) {
ret = -EBADF;
goto out;
free_msg(msg_ptr);
}
out_fput:
- fput(filp);
+ fput_light(filp, fput_needed);
out:
return ret;
}
SYSCALL_DEFINE2(mq_notify, mqd_t, mqdes,
const struct sigevent __user *, u_notification)
{
- int ret;
+ int ret, fput_needed;
struct file *filp;
struct sock *sock;
struct inode *inode;
skb_put(nc, NOTIFY_COOKIE_LEN);
/* and attach it to the socket */
retry:
- filp = fget(notification.sigev_signo);
+ filp = fget_light(notification.sigev_signo, &fput_needed);
if (!filp) {
ret = -EBADF;
goto out;
}
sock = netlink_getsockbyfilp(filp);
- fput(filp);
+ fput_light(filp, fput_needed);
if (IS_ERR(sock)) {
ret = PTR_ERR(sock);
sock = NULL;
}
}
- filp = fget(mqdes);
+ filp = fget_light(mqdes, &fput_needed);
if (!filp) {
ret = -EBADF;
goto out;
}
spin_unlock(&info->lock);
out_fput:
- fput(filp);
+ fput_light(filp, fput_needed);
out:
if (sock) {
netlink_detachskb(sock, nc);
{
int ret;
struct mq_attr mqstat, omqstat;
+ int fput_needed;
struct file *filp;
struct inode *inode;
struct mqueue_inode_info *info;
return -EINVAL;
}
- filp = fget(mqdes);
+ filp = fget_light(mqdes, &fput_needed);
if (!filp) {
ret = -EBADF;
goto out;
ret = -EFAULT;
out_fput:
- fput(filp);
+ fput_light(filp, fput_needed);
out:
return ret;
}