From: Mukesh Ojha <mojha@codeaurora.org>
To: Kangjie Lu <kjlu@umn.edu>
Cc: "Stefan Wahren" <stefan.wahren@i2se.com>,
devel@driverdev.osuosl.org,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Phil Elwell" <phil@raspberrypi.org>,
linux-kernel@vger.kernel.org,
"Tobias Büttner" <tobias.buettner@fau.de>,
"Eric Anholt" <eric@anholt.net>,
"Luis Chamberlain" <mcgrof@kernel.org>,
linux-rpi-kernel@lists.infradead.org, pakki001@umn.edu,
"Dominic Braun" <inf.braun@fau.de>,
"Nicolas Saenz Julienne" <nsaenzjulienne@suse.de>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] vc04_services: vchiq_arm: fix a NULL pointer dereference
Date: Wed, 27 Mar 2019 20:19:24 +0530 [thread overview]
Message-ID: <e04a034b-98e2-ed4b-22d9-833c5d950e18@codeaurora.org> (raw)
In-Reply-To: <20190324224331.1163-1-kjlu@umn.edu>
On 3/25/2019 4:13 AM, Kangjie Lu wrote:
> When kzalloc fails, "platform_state->inited = 1" is a NULL pointer
> dereference. The fix returns VCHIQ_ERROR in case it failed to
> avoid NULL pointer dereference.
>
> Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>
-Mukesh
> ---
> .../staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
> index dd4898861b83..0f12fe617575 100644
> --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
> +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
> @@ -209,6 +209,8 @@ vchiq_platform_init_state(struct vchiq_state *state)
> struct vchiq_2835_state *platform_state;
>
> state->platform_state = kzalloc(sizeof(*platform_state), GFP_KERNEL);
> + if (!state->platform_state)
> + return VCHIQ_ERROR;
> platform_state = (struct vchiq_2835_state *)state->platform_state;
>
> platform_state->inited = 1;
prev parent reply other threads:[~2019-03-27 14:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-24 22:43 Kangjie Lu
2019-03-25 9:15 ` Stefan Wahren
2019-03-27 14:49 ` Mukesh Ojha [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=e04a034b-98e2-ed4b-22d9-833c5d950e18@codeaurora.org \
--to=mojha@codeaurora.org \
--cc=devel@driverdev.osuosl.org \
--cc=eric@anholt.net \
--cc=gregkh@linuxfoundation.org \
--cc=inf.braun@fau.de \
--cc=kjlu@umn.edu \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=mcgrof@kernel.org \
--cc=nsaenzjulienne@suse.de \
--cc=pakki001@umn.edu \
--cc=phil@raspberrypi.org \
--cc=stefan.wahren@i2se.com \
--cc=tobias.buettner@fau.de \
/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
Powered by JetHome