]> Devoid-pointer.net GitWeb - KLGD.git/commitdiff
Remove the helper variable
authorMichal Malý <madcatxster@devoid-pointer.net>
Tue, 26 Aug 2014 00:20:06 +0000 (02:20 +0200)
committerMichal Malý <madcatxster@devoid-pointer.net>
Tue, 26 Aug 2014 00:20:06 +0000 (02:20 +0200)
klgd.c

diff --git a/klgd.c b/klgd.c
index 2050663fdb974969fed82d8bb7934db48b54d8b0..4586ec2a3f85640250a5da329498c11a9a5b85bc 100644 (file)
--- a/klgd.c
+++ b/klgd.c
@@ -32,17 +32,16 @@ static void klgd_schedule_update(struct klgd_main_private *priv);
 struct klgd_command * klgd_alloc_cmd(const size_t length)
 {
        struct klgd_command *cmd = kzalloc(sizeof(struct klgd_command), GFP_KERNEL);
-       char *bytes;
        if (!cmd)
                return NULL;
 
        /* Cast away the const-ness */
-       bytes = kzalloc(sizeof(char) * length, GFP_KERNEL);
-       if (!bytes) {
+       *(char **)(&cmd->bytes) = kzalloc(sizeof(char) * length, GFP_KERNEL);
+       if (!cmd->bytes) {
                kfree(cmd);
                return NULL;
        }
-       *(char **)(&cmd->bytes) = bytes;
+
        cmd->length = length;
        return cmd;
 }