From: Wei Liu <wei.liu@kernel.org>
To: cgel.zte@gmail.com
Cc: kys@microsoft.com, haiyangz@microsoft.com,
sthemmin@microsoft.com, wei.liu@kernel.org, decui@microsoft.com,
linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org,
Lv Ruyi <lv.ruyi@zte.com.cn>, Zeal Robot <zealci@zte.com.cn>,
Tianyu.Lan@microsoft.com
Subject: Re: [PATCH] Drivers: hv : vmbus: Adding NULL pointer check
Date: Thu, 28 Oct 2021 11:42:33 +0000 [thread overview]
Message-ID: <20211028114233.nebhfxgait6qy2xa@liuwe-devbox-debian-v2> (raw)
In-Reply-To: <20211028104138.14576-1-lv.ruyi@zte.com.cn>
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
>
prev parent reply other threads:[~2021-10-28 11:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-28 10:41 [PATCH] Drivers: hv : vmbus: Adding NULL pointer check cgel.zte
2021-10-28 11:42 ` Wei Liu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211028114233.nebhfxgait6qy2xa@liuwe-devbox-debian-v2 \
--to=wei.liu@kernel.org \
--cc=Tianyu.Lan@microsoft.com \
--cc=cgel.zte@gmail.com \
--cc=decui@microsoft.com \
--cc=haiyangz@microsoft.com \
--cc=kys@microsoft.com \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lv.ruyi@zte.com.cn \
--cc=sthemmin@microsoft.com \
--cc=zealci@zte.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).