From: Pierre Ossman Date: Thu, 5 Mar 2009 18:37:28 +0000 (+0100) Subject: sdio: handle cis end marker in link field X-Git-Tag: firefly_0821_release~14784^2~35 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0d6132ba0b006dd2bea9ba0c7b6b2f690cd95c40;p=firefly-linux-kernel-4.4.55.git sdio: handle cis end marker in link field Signed-off-by: Pierre Ossman --- diff --git a/drivers/mmc/core/sdio_cis.c b/drivers/mmc/core/sdio_cis.c index 956bd7677502..6ba93f599281 100644 --- a/drivers/mmc/core/sdio_cis.c +++ b/drivers/mmc/core/sdio_cis.c @@ -227,6 +227,10 @@ static int sdio_read_cis(struct mmc_card *card, struct sdio_func *func) 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;