Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions drivers/net/ethernet/mellanox/mlx4/srq.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,14 @@ void mlx4_srq_event(struct mlx4_dev *dev, u32 srqn, int event_type)
{
struct mlx4_srq_table *srq_table = &mlx4_priv(dev)->srq_table;
struct mlx4_srq *srq;
unsigned long flags;

rcu_read_lock();
spin_lock_irqsave(&srq_table->lock, flags);
srq = radix_tree_lookup(&srq_table->tree, srqn & (dev->caps.num_srqs - 1));
rcu_read_unlock();
if (srq)
refcount_inc(&srq->refcount);
else {
if (!srq || !refcount_inc_not_zero(&srq->refcount))
srq = NULL;
spin_unlock_irqrestore(&srq_table->lock, flags);
if (!srq) {
mlx4_warn(dev, "Async event for bogus SRQ %08x\n", srqn);
return;
}
Expand Down Expand Up @@ -203,8 +204,8 @@ int mlx4_srq_alloc(struct mlx4_dev *dev, u32 pdn, u32 cqn, u16 xrcd,
if (err)
goto err_radix;

refcount_set(&srq->refcount, 1);
init_completion(&srq->free);
atomic_set_release(&srq->refcount.refs, 1);

return 0;

Expand Down
1 change: 1 addition & 0 deletions kernel/exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -934,6 +934,7 @@ void __noreturn make_task_dead(int signr)
futex_exit_recursive(tsk);
tsk->exit_state = EXIT_DEAD;
refcount_inc(&tsk->rcu_users);
preempt_disable();
do_task_dead();
}

Expand Down
1 change: 0 additions & 1 deletion net/netfilter/nft_inner.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ static int nft_inner_parse_l2l3(const struct nft_inner *priv,
return -1;

if (fragoff == 0) {
thoff = nhoff + sizeof(_ip6h);
ctx->flags |= NFT_PAYLOAD_CTX_INNER_TH;
ctx->inner_thoff = thoff;
ctx->l4proto = l4proto;
Expand Down
9 changes: 9 additions & 0 deletions net/sctp/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -1988,6 +1988,15 @@ static int sctp_sendmsg(struct sock *sk, struct msghdr *msg, size_t msg_len)
goto out_unlock;

iov_iter_revert(&msg->msg_iter, err);

/* sctp_sendmsg_to_asoc() may have released the socket
* lock (sctp_wait_for_sndbuf), during which other
* associations on ep->asocs could have been peeled
* off or freed. @asoc itself is revalidated by the
* base.dead and base.sk checks in sctp_wait_for_sndbuf,
* so re-derive the cached cursor from it.
*/
tmp = list_next_entry(asoc, asocs);
}

goto out_unlock;
Expand Down
Loading