kcm: remove redundant -ve error check and return path
authorColin Ian King <colin.king@canonical.com>
Fri, 22 Jul 2016 18:04:12 +0000 (19:04 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 25 Jul 2016 18:17:16 +0000 (11:17 -0700)
The check for a -ve error is redundant, remove it and just
immediately return the return value from the call to
seq_open_net.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/kcm/kcmproc.c

index fda7f4715c58fa4f457f4410e1e3998819a1e77e..16c2e03bd388898a71b82d2837afdaa7d4241a1c 100644 (file)
@@ -88,13 +88,9 @@ struct kcm_proc_mux_state {
 static int kcm_seq_open(struct inode *inode, struct file *file)
 {
        struct kcm_seq_muxinfo *muxinfo = PDE_DATA(inode);
-       int err;
 
-       err = seq_open_net(inode, file, &muxinfo->seq_ops,
+       return seq_open_net(inode, file, &muxinfo->seq_ops,
                           sizeof(struct kcm_proc_mux_state));
-       if (err < 0)
-               return err;
-       return err;
 }
 
 static void kcm_format_mux_header(struct seq_file *seq)