mmc: block: Release index in partition allocation error path
authorUlf Hansson <ulf.hansson@linaro.org>
Thu, 7 Apr 2016 12:23:23 +0000 (14:23 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 2 May 2016 08:33:37 +0000 (10:33 +0200)
If the allocation of a new partition fails, let's make sure to also
release the previously picked device index.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/card/block.c

index 8a0147dfed27d864d419de730499960c54bc202c..9aaf22e676c4b3a1a9248e4824d26711623d3122 100644 (file)
@@ -2289,6 +2289,7 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
  err_kfree:
        kfree(md);
  out:
+       __clear_bit(devidx, dev_use);
        return ERR_PTR(ret);
 }