|
@@ -367,7 +367,8 @@ int __bitmap_parse(const char *buf, unsigned int buflen,
|
|
|
|
|
|
nchunks = nbits = totaldigits = c = 0;
|
|
|
do {
|
|
|
- chunk = ndigits = 0;
|
|
|
+ chunk = 0;
|
|
|
+ ndigits = totaldigits;
|
|
|
|
|
|
/* Get the next chunk of the bitmap */
|
|
|
while (buflen) {
|
|
@@ -406,9 +407,9 @@ int __bitmap_parse(const char *buf, unsigned int buflen,
|
|
|
return -EOVERFLOW;
|
|
|
|
|
|
chunk = (chunk << 4) | hex_to_bin(c);
|
|
|
- ndigits++; totaldigits++;
|
|
|
+ totaldigits++;
|
|
|
}
|
|
|
- if (ndigits == 0)
|
|
|
+ if (ndigits == totaldigits)
|
|
|
return -EINVAL;
|
|
|
if (nchunks == 0 && chunk == 0)
|
|
|
continue;
|