lkml.org 
[lkml]   [2020]   [Jun]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] [perf] Fix null pointer deference in nest_epollfd
Date
Add a NULL check for worker before dereferencing.

Signed-off-by: Gaurav Singh <gaurav1086@gmail.com>
---
tools/perf/bench/epoll-wait.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/tools/perf/bench/epoll-wait.c b/tools/perf/bench/epoll-wait.c
index 75dca9773186..42983eb7f82e 100644
--- a/tools/perf/bench/epoll-wait.c
+++ b/tools/perf/bench/epoll-wait.c
@@ -239,6 +239,9 @@ static void *workerfn(void *arg)

static void nest_epollfd(struct worker *w)
{
+ if (!w)
+ return;
+
unsigned int i;
struct epoll_event ev;
int efd = multiq ? w->epollfd : epollfd;
--
2.17.1
\
 
 \ /
  Last update: 2020-06-18 02:40    [W:0.029 / U:0.448 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site