X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=net%2Firda%2Firlap.c;h=f3236acc8d22e2706e5d1a643c085598cc982352;hb=3ce4af1defe55591925362ca1ef8363ba04e0feb;hp=2fc9f518f89db45771d3514bc9bee1bbef27f96b;hpb=702ed6ef375c19d65f2eeeefd3851476f2c4cee4;p=cascardo%2Flinux.git diff --git a/net/irda/irlap.c b/net/irda/irlap.c index 2fc9f518f89d..f3236acc8d22 100644 --- a/net/irda/irlap.c +++ b/net/irda/irlap.c @@ -95,7 +95,7 @@ int __init irlap_init(void) return 0; } -void __exit irlap_cleanup(void) +void irlap_cleanup(void) { IRDA_ASSERT(irlap != NULL, return;); @@ -1219,29 +1219,11 @@ static const struct seq_operations irlap_seq_ops = { static int irlap_seq_open(struct inode *inode, struct file *file) { - struct seq_file *seq; - int rc = -ENOMEM; - struct irlap_iter_state *s = kzalloc(sizeof(*s), GFP_KERNEL); + if (irlap == NULL) + return -EINVAL; - if (!s) - goto out; - - if (irlap == NULL) { - rc = -EINVAL; - goto out_kfree; - } - - rc = seq_open(file, &irlap_seq_ops); - if (rc) - goto out_kfree; - - seq = file->private_data; - seq->private = s; -out: - return rc; -out_kfree: - kfree(s); - goto out; + return seq_open_private(file, &irlap_seq_ops, + sizeof(struct irlap_iter_state)); } const struct file_operations irlap_seq_fops = {