uml: drivers/net_user.c memory leak fix
authorVitaliy Ivanov <[email protected]>
Tue, 26 Jul 2011 00:12:49 +0000 (17:12 -0700)
committerLinus Torvalds <[email protected]>
Tue, 26 Jul 2011 03:57:12 +0000 (20:57 -0700)
Perform memory cleanup on exit.  On receiving invalid 'pid' we still
should clean 'output' variable.

Signed-off-by: Vitaliy Ivanov <[email protected]>
Signed-off-by: Richard Weinberger <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
arch/um/drivers/net_user.c

index 9415dd9e63ef1e98c15505733c3ba1c1eff02029..520118888f163755fce86c802f55b1ac2c83c8a5 100644 (file)
@@ -228,7 +228,10 @@ static void change(char *dev, char *what, unsigned char *addr,
                       "buffer\n");
 
        pid = change_tramp(argv, output, output_len);
-       if (pid < 0) return;
+       if (pid < 0) {
+               kfree(output);
+               return;
+       }
 
        if (output != NULL) {
                printk("%s", output);