[PATCH v1] Bug fix for issue found by kernel test robot
From: Anjali Kulkarni
Date: Tue Oct 10 2023 - 17:36:02 EST
cn_netlink_send_mult() should be called with filter & filter_data only
for EXIT case. For all other events, filter & filter_data should be
NULL.
Signed-off-by: Anjali Kulkarni <anjali.k.kulkarni@xxxxxxxxxx>
---
drivers/connector/cn_proc.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/connector/cn_proc.c b/drivers/connector/cn_proc.c
index 05d562e9c8b1..01e17f18d187 100644
--- a/drivers/connector/cn_proc.c
+++ b/drivers/connector/cn_proc.c
@@ -104,13 +104,13 @@ static inline void send_msg(struct cn_msg *msg)
if (filter_data[0] == PROC_EVENT_EXIT) {
filter_data[1] =
((struct proc_event *)msg->data)->event_data.exit.exit_code;
+ cn_netlink_send_mult(msg, msg->len, 0, CN_IDX_PROC, GFP_NOWAIT,
+ cn_filter, (void *)filter_data);
} else {
- filter_data[1] = 0;
+ cn_netlink_send_mult(msg, msg->len, 0, CN_IDX_PROC, GFP_NOWAIT,
+ NULL, NULL);
}
- cn_netlink_send_mult(msg, msg->len, 0, CN_IDX_PROC, GFP_NOWAIT,
- cn_filter, (void *)filter_data);
-
local_unlock(&local_event.lock);
}
--
2.42.0