Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3cdeed29 authored by Adrian Bunk's avatar Adrian Bunk Committed by Linus Torvalds
Browse files

kernel/cgroup.c: remove dead code



This patch removes dead code spotted by the Coverity checker
(look at the "(nbytes >= PATH_MAX)" check).

Signed-off-by: default avatarAdrian Bunk <bunk@kernel.org>
Cc: Paul Jackson <pj@sgi.com>
Cc: Paul Menage <menage@google.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 8f1466ff
Loading
Loading
Loading
Loading
+8 −10
Original line number Original line Diff line number Diff line
@@ -1355,16 +1355,14 @@ static ssize_t cgroup_common_file_write(struct cgroup *cgrp,
		if (nbytes && (buffer[nbytes-1] == '\n')) {
		if (nbytes && (buffer[nbytes-1] == '\n')) {
			buffer[nbytes-1] = 0;
			buffer[nbytes-1] = 0;
		}
		}
		if (nbytes < sizeof(root->release_agent_path)) {

		/* We never write anything other than '\0'
		/* We never write anything other than '\0'
		 * into the last char of release_agent_path,
		 * into the last char of release_agent_path,
		 * so it always remains a NUL-terminated
		 * so it always remains a NUL-terminated
		 * string */
		 * string */
		strncpy(root->release_agent_path, buffer, nbytes);
		strncpy(root->release_agent_path, buffer, nbytes);
		root->release_agent_path[nbytes] = 0;
		root->release_agent_path[nbytes] = 0;
		} else {

			retval = -ENOSPC;
		}
		break;
		break;
	}
	}
	default:
	default: