From patchwork Mon Apr 18 11:43:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 66020 Delivered-To: patches@linaro.org Received: by 10.140.93.198 with SMTP id d64csp1233925qge; Mon, 18 Apr 2016 04:44:10 -0700 (PDT) X-Received: by 10.25.208.144 with SMTP id h138mr11290173lfg.48.1460979849901; Mon, 18 Apr 2016 04:44:09 -0700 (PDT) Return-Path: Received: from mail-lf0-x236.google.com (mail-lf0-x236.google.com. [2a00:1450:4010:c07::236]) by mx.google.com with ESMTPS id j141si22809276lfe.57.2016.04.18.04.44.09 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Apr 2016 04:44:09 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::236 as permitted sender) client-ip=2a00:1450:4010:c07::236; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::236 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by mail-lf0-x236.google.com with SMTP id e190so213290350lfe.0 for ; Mon, 18 Apr 2016 04:44:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=jKUDTw73jxzp4qtK6fL9C1QMTjQz6oM52wUhX+EirPU=; b=VWf/XA7Tui/JcZ+gX9EF3RMRWU5fHk13SGmvo9MIgrbd8Sujnrto4xIKJq3jUlc9n6 dlTYBZ4++1kqiSiKaETNk3If2s76eTyYy+qGREIMSxKU6+6a04AlJ7Zb8NdBD475HFEr 2ZYH0jzvdE8v25K7toP1ToxgG/UDq6kTgi85A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=jKUDTw73jxzp4qtK6fL9C1QMTjQz6oM52wUhX+EirPU=; b=OyMZgAzu4U1QJLsjZuKorPYZZEjUFcabtXbE47J2S2D9eWzTjoIcBNmpFkNBMfgj9m VDETXCfGfVc1oSxQL7TjYrumKLRuufjfMsA4aDLYKEL2c9m474BzglCL9aKrBPqn2fWv vdK4Wnow3RXCNpEB++AvlPjjr2Xyh9PN6ANTKqlHsr1t03cCZ1Lskg4T8jj/R0P9R5ST AiI/wFIZYVnJeJKZbhl1KBtJ/4eYf4h5O2KX1S1f/vNjw5WN11TMgXHCA7EidC1JQMZ+ +vywr8QKVVrsLd5Z1mAmic+fBlLfhZutcr/1bhKJJaMCyAGg2yCSAWmdkQmNfaNyhh2c MPOg== X-Gm-Message-State: AOPr4FUq21RFr4sOd8bOWq6IkREF4thNJrgxFDlwZqdgBPA8lKe6fnMtyKWugv/JkFEWqmNa4wY= X-Received: by 10.112.124.197 with SMTP id mk5mr1377121lbb.60.1460979849653; Mon, 18 Apr 2016 04:44:09 -0700 (PDT) Return-Path: Received: from uffe-Latitude-E6430s.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id jo1sm10010232lbc.3.2016.04.18.04.44.07 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 18 Apr 2016 04:44:08 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson Subject: [PATCH 2/3] mmc: block: Release index in partition allocation error path Date: Mon, 18 Apr 2016 13:43:53 +0200 Message-Id: <1460979834-24582-2-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1460979834-24582-1-git-send-email-ulf.hansson@linaro.org> References: <1460979834-24582-1-git-send-email-ulf.hansson@linaro.org> 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 --- drivers/mmc/card/block.c | 1 + 1 file changed, 1 insertion(+) -- 1.9.1 diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index 8a0147d..9aaf22e 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -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); }