]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/mmc/core/sdio_cis.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
[linux-2.6-omap-h63xx.git] / drivers / mmc / core / sdio_cis.c
index 956bd7677502c3c1ebe69d3c03f65641abce060e..963f2937c5e37da83819249826995aa098751f99 100644 (file)
@@ -223,10 +223,18 @@ static int sdio_read_cis(struct mmc_card *card, struct sdio_func *func)
                if (tpl_code == 0xff)
                        break;
 
+               /* null entries have no link field or data */
+               if (tpl_code == 0x00)
+                       continue;
+
                ret = mmc_io_rw_direct(card, 0, 0, ptr++, 0, &tpl_link);
                if (ret)
                        break;
 
+               /* a size of 0xff also means we're done */
+               if (tpl_link == 0xff)
+                       break;
+
                this = kmalloc(sizeof(*this) + tpl_link, GFP_KERNEL);
                if (!this)
                        return -ENOMEM;