From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, Colin Ian King <colin.king@canonical.com>,
David Daney <david.daney@cavium.com>,
Ralf Baechle <ralf@linux-mips.org>,
"Steven J. Hill" <Steven.Hill@cavium.com>,
linux-mips@linux-mips.org, James Hogan <jhogan@kernel.org>
Subject: [PATCH 4.14 080/140] MIPS: OCTEON: irq: Check for null return on kzalloc allocation
Date: Tue, 13 Mar 2018 16:24:43 +0100 [thread overview]
Message-ID: <20180313152503.512478971@linuxfoundation.org> (raw)
In-Reply-To: <20180313152458.201155692@linuxfoundation.org>
4.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Colin Ian King <colin.king@canonical.com>
commit 902f4d067a50ccf645a58dd5fb1d113b6e0f9b5b upstream.
The allocation of host_data is not null checked, leading to a null
pointer dereference if the allocation fails. Fix this by adding a null
check and return with -ENOMEM.
Fixes: 64b139f97c01 ("MIPS: OCTEON: irq: add CIB and other fixes")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: David Daney <david.daney@cavium.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: "Steven J. Hill" <Steven.Hill@cavium.com>
Cc: linux-mips@linux-mips.org
Cc: <stable@vger.kernel.org> # 4.0+
Patchwork: https://patchwork.linux-mips.org/patch/18658/
Signed-off-by: James Hogan <jhogan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/mips/cavium-octeon/octeon-irq.c | 2 ++
1 file changed, 2 insertions(+)
--- a/arch/mips/cavium-octeon/octeon-irq.c
+++ b/arch/mips/cavium-octeon/octeon-irq.c
@@ -2277,6 +2277,8 @@ static int __init octeon_irq_init_cib(st
}
host_data = kzalloc(sizeof(*host_data), GFP_KERNEL);
+ if (!host_data)
+ return -ENOMEM;
raw_spin_lock_init(&host_data->lock);
addr = of_get_address(ciu_node, 0, NULL, NULL);
next prev parent reply other threads:[~2018-03-13 15:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20180313152458.201155692@linuxfoundation.org>
2018-03-13 15:24 ` [PATCH 4.14 078/140] MIPS: BMIPS: Do not mask IPIs during suspend Greg Kroah-Hartman
2018-03-13 15:24 ` [PATCH 4.14 079/140] MIPS: ath25: Check for kzalloc allocation failure Greg Kroah-Hartman
2018-03-13 15:24 ` Greg Kroah-Hartman [this message]
2018-03-13 15:25 ` [PATCH 4.14 113/140] dt-bindings: Document mti,mips-cpc binding Greg Kroah-Hartman
2018-03-13 15:25 ` [PATCH 4.14 114/140] MIPS: CPC: Map registers using DT in mips_cpc_default_phys_base() Greg Kroah-Hartman
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=20180313152503.512478971@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=Steven.Hill@cavium.com \
--cc=colin.king@canonical.com \
--cc=david.daney@cavium.com \
--cc=jhogan@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.org \
--cc=stable@vger.kernel.org \
/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