From: Florian Fainelli <f.fainelli@gmail.com>
To: QintaoShen <unSimple1993@163.com>, f.fainelli@gmail.com
Cc: bcm-kernel-feedback-list@broadcom.com,
linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] soc: bcm: Check for NULL return of devm_kzalloc()
Date: Tue, 19 Apr 2022 11:33:48 -0700 [thread overview]
Message-ID: <f8d78967-8842-57de-9464-4e281de2e7d7@gmail.com> (raw)
In-Reply-To: <1648110940-4684-1-git-send-email-unSimple1993@163.com>
On 3/24/2022 1:35 AM, QintaoShen wrote:
> As the potential failuer of allocation, devm_kzalloc() may return NULL.
> Then the 'pd->pmb' and the follow lines of code may bring null pointer dereference.
>
> Therefore, it is better to check the return value of devm_kzalloc() to avoid this confusion.
>
> Signed-off-by: QintaoShen <unSimple1993@163.com>
Applied to https://github.com/Broadcom/stblinux/commits/drivers/next,
thanks!
I modified your patch to have a Fixes: tag as replied, and follow
Sergey's style recommendation.
--
Florian
prev parent reply other threads:[~2022-04-19 18:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-24 8:35 [PATCH v1] soc: bcm: Check for NULL return of devm_kzalloc() QintaoShen
2022-03-24 17:04 ` Florian Fainelli
2022-03-25 9:02 ` Sergey Shtylyov
2022-03-28 4:13 ` QintaoShen
2022-04-19 18:33 ` Florian Fainelli [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=f8d78967-8842-57de-9464-4e281de2e7d7@gmail.com \
--to=f.fainelli@gmail.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=unSimple1993@163.com \
/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