|
@@ -2034,8 +2034,20 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
|
|
int devidx, ret;
|
|
int devidx, ret;
|
|
|
|
|
|
devidx = ida_simple_get(&mmc_blk_ida, 0, max_devices, GFP_KERNEL);
|
|
devidx = ida_simple_get(&mmc_blk_ida, 0, max_devices, GFP_KERNEL);
|
|
- if (devidx < 0)
|
|
|
|
|
|
+ if (devidx < 0) {
|
|
|
|
+ /*
|
|
|
|
+ * We get -ENOSPC because there are no more any available
|
|
|
|
+ * devidx. The reason may be that, either userspace haven't yet
|
|
|
|
+ * unmounted the partitions, which postpones mmc_blk_release()
|
|
|
|
+ * from being called, or the device has more partitions than
|
|
|
|
+ * what we support.
|
|
|
|
+ */
|
|
|
|
+ if (devidx == -ENOSPC)
|
|
|
|
+ dev_err(mmc_dev(card->host),
|
|
|
|
+ "no more device IDs available\n");
|
|
|
|
+
|
|
return ERR_PTR(devidx);
|
|
return ERR_PTR(devidx);
|
|
|
|
+ }
|
|
|
|
|
|
md = kzalloc(sizeof(struct mmc_blk_data), GFP_KERNEL);
|
|
md = kzalloc(sizeof(struct mmc_blk_data), GFP_KERNEL);
|
|
if (!md) {
|
|
if (!md) {
|