Skip to content

Commit 13a6691

Browse files
chiarameiohasrleon
authored andcommitted
RDMA/nldev: Set error code in rdma_nl_notify_event
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>
1 parent 7179fe0 commit 13a6691

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/infiniband/core/nldev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2833,8 +2833,8 @@ int rdma_nl_notify_event(struct ib_device *device, u32 port_num,
28332833
enum rdma_nl_notify_event_type type)
28342834
{
28352835
struct sk_buff *skb;
2836+
int ret = -EMSGSIZE;
28362837
struct net *net;
2837-
int ret = 0;
28382838
void *nlh;
28392839

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

0 commit comments

Comments
 (0)