Skip to content

Commit

Permalink
net: qrtr: Fix passing invalid reference to qrtr_local_enqueue()
Browse files Browse the repository at this point in the history
Once the traversal of the list is completed with list_for_each_entry(),
the iterator (node) will point to an invalid object. So passing this to
qrtr_local_enqueue() which is outside of the iterator block is erroneous
eventhough the object is not used.

So fix this by passing NULL to qrtr_local_enqueue().

Fixes: bdabad3 ("net: Add Qualcomm IPC router")
Reported-by: kbuild test robot <[email protected]>
Reported-by: Julia Lawall <[email protected]>
Signed-off-by: Manivannan Sadhasivam <[email protected]>
Reviewed-by: Bjorn Andersson <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Mani-Sadhasivam authored and davem330 committed May 22, 2020
1 parent 7c87e32 commit d28ea1f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/qrtr/qrtr.c
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ static int qrtr_bcast_enqueue(struct qrtr_node *node, struct sk_buff *skb,
}
mutex_unlock(&qrtr_node_lock);

qrtr_local_enqueue(node, skb, type, from, to);
qrtr_local_enqueue(NULL, skb, type, from, to);

return 0;
}
Expand Down

0 comments on commit d28ea1f

Please sign in to comment.