[lxc-devel] [lxcfs/master] sysfs_fuse: remove logically dead code

brauner on Github lxc-bot at linuxcontainers.org
Tue Apr 28 11:25:27 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 390 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200428/ceb66aca/attachment.bin>
-------------- next part --------------
From 133cba4786ab9f7ae68cda0251baa7a0af77116a Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Tue, 28 Apr 2020 13:24:00 +0200
Subject: [PATCH] sysfs_fuse: remove logically dead code

Fixes: Coverity 357808.
Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
 src/sysfs_fuse.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/sysfs_fuse.c b/src/sysfs_fuse.c
index 06073c4..d6f7876 100644
--- a/src/sysfs_fuse.c
+++ b/src/sysfs_fuse.c
@@ -101,10 +101,8 @@ static int sys_devices_system_cpu_online_read(char *buf, size_t size,
 			total_len = snprintf(d->buf, d->buflen, "0-%d\n", max_cpus - 1);
 		else
 			total_len = snprintf(d->buf, d->buflen, "0\n");
-	} else if (cpuset) {
-		total_len = snprintf(d->buf, d->buflen, "%s\n", cpuset);
 	} else {
-		return read_file_fuse("/sys/devices/system/cpu/online", buf, size, d);
+		total_len = snprintf(d->buf, d->buflen, "%s\n", cpuset);
 	}
 	if (total_len < 0 || total_len >= d->buflen)
 		return log_error(0, "Failed to write to cache");


More information about the lxc-devel mailing list