lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 14 Sep 2022 14:04:28 +0800
From:   Li zeming <zeming@...china.com>
To:     James.Bottomley@...senPartnership.com, deller@....de
Cc:     linux-parisc@...r.kernel.org, linux-kernel@...r.kernel.org,
        Li zeming <zeming@...china.com>
Subject: [PATCH] parisc: Increase the usage check of kmalloc allocated object a

In the case of memory allocation failure, no alignment operation is
required.

Signed-off-by: Li zeming <zeming@...china.com>
---
 drivers/parisc/iosapic.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/parisc/iosapic.c b/drivers/parisc/iosapic.c
index 3a8c98615634..33de438916d3 100644
--- a/drivers/parisc/iosapic.c
+++ b/drivers/parisc/iosapic.c
@@ -229,7 +229,9 @@ static struct irt_entry *iosapic_alloc_irt(int num_entries)
 	 * 4-byte alignment on 32-bit kernels
 	 */
 	a = (unsigned long)kmalloc(sizeof(struct irt_entry) * num_entries + 8, GFP_KERNEL);
-	a = (a + 7UL) & ~7UL;
+	if (a)
+		a = (a + 7UL) & ~7UL;
+
 	return (struct irt_entry *)a;
 }
 
-- 
2.18.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ