Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3cdeed2986b09fcc77b4812ca10dbc057e4e5f8c
Commit:     3cdeed2986b09fcc77b4812ca10dbc057e4e5f8c
Parent:     8f1466ff0a6e81653e9bb0d9247495bf4e9db7e2
Author:     Adrian Bunk <[EMAIL PROTECTED]>
AuthorDate: Thu Feb 7 00:13:43 2008 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Thu Feb 7 08:42:17 2008 -0800

    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: Adrian Bunk <[EMAIL PROTECTED]>
    Cc: Paul Jackson <[EMAIL PROTECTED]>
    Cc: Paul Menage <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 kernel/cgroup.c |   18 ++++++++----------
 1 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 1a3c239..ae36747 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -1355,16 +1355,14 @@ static ssize_t cgroup_common_file_write(struct cgroup 
*cgrp,
                if (nbytes && (buffer[nbytes-1] == '\n')) {
                        buffer[nbytes-1] = 0;
                }
-               if (nbytes < sizeof(root->release_agent_path)) {
-                       /* We never write anything other than '\0'
-                        * into the last char of release_agent_path,
-                        * so it always remains a NUL-terminated
-                        * string */
-                       strncpy(root->release_agent_path, buffer, nbytes);
-                       root->release_agent_path[nbytes] = 0;
-               } else {
-                       retval = -ENOSPC;
-               }
+
+               /* We never write anything other than '\0'
+                * into the last char of release_agent_path,
+                * so it always remains a NUL-terminated
+                * string */
+               strncpy(root->release_agent_path, buffer, nbytes);
+               root->release_agent_path[nbytes] = 0;
+
                break;
        }
        default:
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to