|
@@ -267,7 +267,7 @@ static void sdio_release_func(struct device *dev)
|
|
sdio_free_func_cis(func);
|
|
sdio_free_func_cis(func);
|
|
|
|
|
|
kfree(func->info);
|
|
kfree(func->info);
|
|
-
|
|
|
|
|
|
+ kfree(func->tmpbuf);
|
|
kfree(func);
|
|
kfree(func);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -282,6 +282,16 @@ struct sdio_func *sdio_alloc_func(struct mmc_card *card)
|
|
if (!func)
|
|
if (!func)
|
|
return ERR_PTR(-ENOMEM);
|
|
return ERR_PTR(-ENOMEM);
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
+ * allocate buffer separately to make sure it's properly aligned for
|
|
|
|
+ * DMA usage (incl. 64 bit DMA)
|
|
|
|
+ */
|
|
|
|
+ func->tmpbuf = kmalloc(4, GFP_KERNEL);
|
|
|
|
+ if (!func->tmpbuf) {
|
|
|
|
+ kfree(func);
|
|
|
|
+ return ERR_PTR(-ENOMEM);
|
|
|
|
+ }
|
|
|
|
+
|
|
func->card = card;
|
|
func->card = card;
|
|
|
|
|
|
device_initialize(&func->dev);
|
|
device_initialize(&func->dev);
|