Skip to content

Commit

Permalink
RDMA/nldev: Set error code in rdma_nl_notify_event
Browse files Browse the repository at this point in the history
In case of error set the error code before the goto.

Fixes: 6ff57a2 ("RDMA/nldev: Fix NULL pointer dereferences issue in rdma_nl_notify_event")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/linux-rdma/a84a2fc3-33b6-46da-a1bd-3343fa07eaf9@stanley.mountain/
Signed-off-by: Chiara Meiohas <cmeiohas@nvidia.com>
Reviewed-by: Maher Sanalla <msanalla@nvidia.com>
Link: https://patch.msgid.link/13eb25961923f5de9eb9ecbbc94e26113d6049ef.1733815944.git.leonro@nvidia.com
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
  • Loading branch information
Chiara Meiohas authored and Leon Romanovsky committed Dec 19, 2024
1 parent 7179fe0 commit 13a6691
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/infiniband/core/nldev.c
Original file line number Diff line number Diff line change
Expand Up @@ -2833,8 +2833,8 @@ int rdma_nl_notify_event(struct ib_device *device, u32 port_num,
enum rdma_nl_notify_event_type type)
{
struct sk_buff *skb;
int ret = -EMSGSIZE;
struct net *net;
int ret = 0;
void *nlh;

net = read_pnet(&device->coredev.rdma_net);
Expand Down

0 comments on commit 13a6691

Please sign in to comment.