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>] [day] [month] [year] [list]
Message-Id: <20191030163040.70055-1-john.stultz@linaro.org>
Date:   Wed, 30 Oct 2019 16:30:40 +0000
From:   John Stultz <john.stultz@...aro.org>
To:     lkml <linux-kernel@...r.kernel.org>
Cc:     John Stultz <john.stultz@...aro.org>,
        Colin King <colin.king@...onical.com>,
        Sumit Semwal <sumit.semwal@...aro.org>,
        Benjamin Gaignard <benjamin.gaignard@...aro.org>,
        Liam Mark <lmark@...eaurora.org>,
        Laura Abbott <labbott@...hat.com>,
        Brian Starkey <brian.starkey@....com>,
        "Andrew F . Davis" <afd@...com>, dri-devel@...ts.freedesktop.org,
        linaro-mm-sig@...ts.linaro.org, kernel-janitors@...r.kernel.org
Subject: [PATCH] dma-buf: heaps: Fix redundant assignment to variable ret in system_heap.c

Colin King reported a coverity error:
 The variable ret is being assigned with a value that is never
 read, it is being re-assigned the same value on the err0 exit
 path. The assignment is redundant and hence can be removed.

He had a fix, but Andrew Davis suggested a better solution
(actually returning ret), so this patch implements that fix.

Cc: Colin King <colin.king@...onical.com>
Cc: Sumit Semwal <sumit.semwal@...aro.org>
Cc: Benjamin Gaignard <benjamin.gaignard@...aro.org>
Cc: Liam Mark <lmark@...eaurora.org>
Cc: Laura Abbott <labbott@...hat.com>
Cc: Brian Starkey <brian.starkey@....com>
Cc: Andrew F. Davis <afd@...com>
Cc: dri-devel@...ts.freedesktop.org
Cc: linaro-mm-sig@...ts.linaro.org
Cc: kernel-janitors@...r.kernel.org
Addresses-Coverity: ("Unused value")
Fixes: 47a32f9c1226 ("dma-buf: heaps: Add system heap to dmabuf heaps")
Reported-by: Colin Ian King <colin.king@...onical.com>
Suggested-by: Andrew F. Davis <afd@...com>
Signed-off-by: John Stultz <john.stultz@...aro.org>
---
 drivers/dma-buf/heaps/system_heap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma-buf/heaps/system_heap.c b/drivers/dma-buf/heaps/system_heap.c
index 455782efbb32..9a56393e40b4 100644
--- a/drivers/dma-buf/heaps/system_heap.c
+++ b/drivers/dma-buf/heaps/system_heap.c
@@ -98,7 +98,7 @@ static int system_heap_allocate(struct dma_heap *heap,
 err0:
 	kfree(helper_buffer);
 
-	return -ENOMEM;
+	return ret;
 }
 
 static const struct dma_heap_ops system_heap_ops = {
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ