projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0b90608
)
Drivers: hv : vmbus: Adding NULL pointer check
author
Lv Ruyi
<lv.ruyi@zte.com.cn>
Thu, 28 Oct 2021 10:41:38 +0000
(10:41 +0000)
committer
Wei Liu
<wei.liu@kernel.org>
Thu, 28 Oct 2021 11:40:32 +0000
(11:40 +0000)
This patch fixes the following Coccinelle warning:
drivers/hv/ring_buffer.c:223: alloc with no test
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
Link:
https://lore.kernel.org/r/20211028104138.14576-1-lv.ruyi@zte.com.cn
Signed-off-by: Wei Liu <wei.liu@kernel.org>
drivers/hv/ring_buffer.c
patch
|
blob
|
history
diff --git
a/drivers/hv/ring_buffer.c
b/drivers/hv/ring_buffer.c
index
931802a
..
71efacb
100644
(file)
--- a/
drivers/hv/ring_buffer.c
+++ b/
drivers/hv/ring_buffer.c
@@
-223,6
+223,8
@@
int hv_ringbuffer_init(struct hv_ring_buffer_info *ring_info,
pages_wraparound = kcalloc(page_cnt * 2 - 1,
sizeof(struct page *),
GFP_KERNEL);
+ if (!pages_wraparound)
+ return -ENOMEM;
pages_wraparound[0] = pages;
for (i = 0; i < 2 * (page_cnt - 1); i++)