]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/isdn/capi/capidrv.c
Merge branch 'master' into tk71
[mv-sheeva.git] / drivers / isdn / capi / capidrv.c
index 2978bdaa6b8823473a029bce120237b94e133c2f..92607ed25e2ec5569c85881f95db37237bf36bfc 100644 (file)
@@ -1515,8 +1515,13 @@ static int decodeFVteln(char *teln, unsigned long *bmaskp, int *activep)
        while (*s) {
                int digit1 = 0;
                int digit2 = 0;
-               if (!isdigit(*s)) return -3;
-               while (isdigit(*s)) { digit1 = digit1*10 + (*s - '0'); s++; }
+               char *endp;
+
+               digit1 = simple_strtoul(s, &endp, 10);
+               if (s == endp)
+                       return -3;
+               s = endp;
+
                if (digit1 <= 0 || digit1 > 30) return -4;
                if (*s == 0 || *s == ',' || *s == ' ') {
                        bmask |= (1 << digit1);
@@ -1526,8 +1531,12 @@ static int decodeFVteln(char *teln, unsigned long *bmaskp, int *activep)
                }
                if (*s != '-') return -5;
                s++;
-               if (!isdigit(*s)) return -3;
-               while (isdigit(*s)) { digit2 = digit2*10 + (*s - '0'); s++; }
+
+               digit2 = simple_strtoul(s, &endp, 10);
+               if (s == endp)
+                       return -3;
+               s = endp;
+
                if (digit2 <= 0 || digit2 > 30) return -4;
                if (*s == 0 || *s == ',' || *s == ' ') {
                        if (digit1 > digit2)
@@ -2288,6 +2297,7 @@ static int __init capidrv_init(void)
 
        errcode = capi20_get_profile(0, &profile);
        if (errcode != CAPI_NOERROR) {
+               unregister_capictr_notifier(&capictr_nb);
                capi20_release(&global.ap);
                return -EIO;
        }