]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/isdn/i4l/isdn_ppp.c
Merge remote-tracking branch 'input-current/for-linus'
[karo-tx-linux.git] / drivers / isdn / i4l / isdn_ppp.c
index c4198fa490bfac50dd3c05fa324502d4e6f228c8..9c1e8adaf4fc825c54ff84e9c85d36a68ecb5da7 100644 (file)
@@ -301,6 +301,8 @@ isdn_ppp_open(int min, struct file *file)
        is->compflags = 0;
 
        is->reset = isdn_ppp_ccp_reset_alloc(is);
+       if (!is->reset)
+               return -ENOMEM;
 
        is->lp = NULL;
        is->mp_seqno = 0;       /* MP sequence number */
@@ -320,6 +322,10 @@ isdn_ppp_open(int min, struct file *file)
         * VJ header compression init
         */
        is->slcomp = slhc_init(16, 16); /* not necessary for 2. link in bundle */
+       if (IS_ERR(is->slcomp)) {
+               isdn_ppp_ccp_reset_free(is);
+               return PTR_ERR(is->slcomp);
+       }
 #endif
 #ifdef CONFIG_IPPP_FILTER
        is->pass_filter = NULL;
@@ -567,10 +573,8 @@ isdn_ppp_ioctl(int min, struct file *file, unsigned int cmd, unsigned long arg)
                        is->maxcid = val;
 #ifdef CONFIG_ISDN_PPP_VJ
                        sltmp = slhc_init(16, val);
-                       if (!sltmp) {
-                               printk(KERN_ERR "ippp, can't realloc slhc struct\n");
-                               return -ENOMEM;
-                       }
+                       if (IS_ERR(sltmp))
+                               return PTR_ERR(sltmp);
                        if (is->slcomp)
                                slhc_free(is->slcomp);
                        is->slcomp = sltmp;