--- zzzz-none-000/linux-2.6.19.2/drivers/mtd/devices/doc2001.c 2007-01-10 19:10:37.000000000 +0000 +++ davinci-8020-5504/linux-2.6.19.2/drivers/mtd/devices/doc2001.c 2007-01-19 14:42:56.000000000 +0000 @@ -401,6 +401,8 @@ /* Don't allow read past end of device */ if (from >= this->totlen) return -EINVAL; + if (!len) + return -EINVAL; /* Don't allow a single read to cross a 512-byte block boundary */ if (from + len > ((from | 0x1ff) + 1))