[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200122074807.10849-1-weiyongjun1@huawei.com>
Date: Wed, 22 Jan 2020 07:48:07 +0000
From: Wei Yongjun <weiyongjun1@...wei.com>
To: David Howells <dhowells@...hat.com>
CC: Wei Yongjun <weiyongjun1@...wei.com>,
<linux-kernel@...r.kernel.org>, <kernel-janitors@...r.kernel.org>
Subject: [PATCH -next v2] watch_queue: fix error return code in watch_queue_set_size()
Fix to return negative error code -ENOMEM from the error handling
case instead of 0, as done elsewhere in this function.
Fixes: 009b0aa00c5a ("pipe: Add general notification queue support")
Signed-off-by: Wei Yongjun <weiyongjun1@...wei.com>
---
kernel/watch_queue.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/watch_queue.c b/kernel/watch_queue.c
index f195cbbbb3d3..f1028761cb9c 100644
--- a/kernel/watch_queue.c
+++ b/kernel/watch_queue.c
@@ -251,6 +251,7 @@ long watch_queue_set_size(struct pipe_inode_info *pipe, unsigned int nr_notes)
if (ret < 0)
goto error;
+ ret = -ENOMEM;
pages = kcalloc(sizeof(struct page *), nr_pages, GFP_KERNEL);
if (!pages)
goto error;
Powered by blists - more mailing lists