* [PATCH] Drivers: hv : vmbus: Adding NULL pointer check
@ 2021-10-28 10:41 cgel.zte
2021-10-28 11:42 ` Wei Liu
0 siblings, 1 reply; 2+ messages in thread
From: cgel.zte @ 2021-10-28 10:41 UTC (permalink / raw)
To: kys
Cc: haiyangz, sthemmin, wei.liu, decui, linux-hyperv, linux-kernel,
Lv Ruyi, Zeal Robot
From: Lv Ruyi <lv.ruyi@zte.com.cn>
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>
---
drivers/hv/ring_buffer.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/hv/ring_buffer.c b/drivers/hv/ring_buffer.c
index 931802ae985c..4ef5c3771079 100644
--- 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++)
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Drivers: hv : vmbus: Adding NULL pointer check
2021-10-28 10:41 [PATCH] Drivers: hv : vmbus: Adding NULL pointer check cgel.zte
@ 2021-10-28 11:42 ` Wei Liu
0 siblings, 0 replies; 2+ messages in thread
From: Wei Liu @ 2021-10-28 11:42 UTC (permalink / raw)
To: cgel.zte
Cc: kys, haiyangz, sthemmin, wei.liu, decui, linux-hyperv,
linux-kernel, Lv Ruyi, Zeal Robot, Tianyu.Lan
On Thu, Oct 28, 2021 at 10:41:38AM +0000, cgel.zte@gmail.com wrote:
> From: Lv Ruyi <lv.ruyi@zte.com.cn>
>
> 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>
> ---
> drivers/hv/ring_buffer.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/hv/ring_buffer.c b/drivers/hv/ring_buffer.c
> index 931802ae985c..4ef5c3771079 100644
> --- 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;
>
(CC Tianyu)
This hunk appears to have been mistakenly deleted by Tianyu's IVM patch
set.
Thanks for noticing this.
Applied to hyperv-next. No "fixes@ tag needed here.
Wei.
> pages_wraparound[0] = pages;
> for (i = 0; i < 2 * (page_cnt - 1); i++)
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-10-28 11:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-28 10:41 [PATCH] Drivers: hv : vmbus: Adding NULL pointer check cgel.zte
2021-10-28 11:42 ` Wei Liu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).