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]
Message-Id: <5533660490db4a91bb25e3984c3d6bd20eb230f6.1505899966.git.arvind.yadav.cs@gmail.com>
Date:   Wed, 20 Sep 2017 15:10:58 +0530
From:   Arvind Yadav <arvind.yadav.cs@...il.com>
To:     p.zabel@...gutronix.de, mchehab@...nel.org, hans.verkuil@...co.com,
        sean@...s.org, andi.shyti@...sung.com
Cc:     linux-media@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH v2 1/2] [media] coda: Handle return value of kasprintf

kasprintf() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@...il.com>
---
changes in v2 :
	Calling coda_free_framebuffers to release already allocated buffers.

 drivers/media/platform/coda/coda-bit.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/media/platform/coda/coda-bit.c b/drivers/media/platform/coda/coda-bit.c
index 291c409..bfc4ecf 100644
--- a/drivers/media/platform/coda/coda-bit.c
+++ b/drivers/media/platform/coda/coda-bit.c
@@ -417,6 +417,10 @@ static int coda_alloc_framebuffers(struct coda_ctx *ctx,
 		    dev->devtype->product != CODA_DX6)
 			size += ysize / 4;
 		name = kasprintf(GFP_KERNEL, "fb%d", i);
+		if (!name) {
+			coda_free_framebuffers(ctx);
+			return -ENOMEM;
+		}
 		ret = coda_alloc_context_buf(ctx, &ctx->internal_frames[i],
 					     size, name);
 		kfree(name);
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ