ppp, slip: Validate VJ compression slot parameters completely
[linux-3.10.git] / drivers / isdn / i4l / isdn_ppp.c
index 12bcce1..0ed6731 100644 (file)
@@ -322,9 +322,9 @@ 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->slcomp) {
+       if (IS_ERR(is->slcomp)) {
                isdn_ppp_ccp_reset_free(is);
-               return -ENOMEM;
+               return PTR_ERR(is->slcomp);
        }
 #endif
 #ifdef CONFIG_IPPP_FILTER
@@ -574,10 +574,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;