Message ID | 20200430091640.455-2-ulf.hansson@linaro.org |
---|---|
State | New |
Headers | show
Delivered-To: patches@linaro.org Received: by 2002:a92:3d9a:0:0:0:0:0 with SMTP id k26csp1839041ilf; Thu, 30 Apr 2020 02:16:59 -0700 (PDT) X-Received: by 2002:ac2:418b:: with SMTP id z11mr755408lfh.30.1588238219000; Thu, 30 Apr 2020 02:16:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588238218; cv=none; d=google.com; s=arc-20160816; b=CHeEACa+syCBIuMVSMTM4df5EmOXrgsndyn6PclAywA9rwLKDbycaIDg0tIXN4qr6y 9OCARj9iwmJTrDA/+TXWv4aH5qipzzr2ISvkL7XWRlpLoNIOSalgIeHfgM4HIgj4dRUJ dx0gAnLOD5Jc6e/Rp1NQLmuobW9ybObmrxlYhZIhk2EsdRSrtLuI92q0drczHzYbODe1 V9QGFbZOofR/oEzVtW9RoABIOGnTXOriJou8eNeHzMxsyla0eUxd/OG1auPhy0fCkVcf J25KBOyhdXAe3GSRm3fBO2SuYKnOXrYgUHvj+YBKnu00FVv5mq60At2nqBUnxAofzAUA cQcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=qAMZhL85o785efprM1NP2kmSTjnBd3DKp3TTm2/2pLw=; b=oykNnnvbdDR5Gp9Qly/Qltnvp/2KQ84Ux9b+mtd9efcmaMC3tc5CoTI+B3Qy6WwW7T 9ARM8LQhTMROrzKPjxItPDl6PqDUm4jW210jFj04VGQTVJ9Mka+VViBfUxwVOLwnbqMC hD/yrme1TMXIXDzTyR3tx8eFKoRvmwmSZru65+4/256WzIrp0xPD6jf4n+LFWxIWnAwZ YLh4HpZa8G/jZzwjbq7QOP3OE5iR2VQH58BIx6kwmz6gSVvFjIDi/1fgyyORqi0GS0qd CFYaD/44O8D/ZBCkDpZZsEQZcNxKyKwAUWDtEBD+J/fviGAMrYa3Op7s4Xf05Vy6HnQl PkYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VUHf05to; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: <ulf.hansson@linaro.org> Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id m5sor3636653lji.11.2020.04.30.02.16.58 for <patches@linaro.org> (Google Transport Security); Thu, 30 Apr 2020 02:16:58 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VUHf05to; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qAMZhL85o785efprM1NP2kmSTjnBd3DKp3TTm2/2pLw=; b=VUHf05tojt/8dBM7x8qriL+LZ5NSWiYL6ASfP0/qa6Z9WAiEfoL0VwjcYukMjohKAb IL3ataGrAGmqEvD+4NaBt2zCS/93XwBYOhc8YeP4b+2KAhUtSCWGHgcunC686tBuERjN JksemGXqBS/YkvykkQvS0KcGJ86LWPedSfqGfw8zWHtGAkLRMhkhr2GGLkz3YzbEtzVw /RNA47eQ6QSFWQVl0WCRRZHBN5EHtQcn4P3YphuQjrDURAjexH30bXSaiy1wluST12zj QX9GIE3S1R+B5Te/YJFb4HrtTuurnNQP8SJUQi6y8lyZRv1o6N9eqE6uXTpPgXCxIULc 8reg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qAMZhL85o785efprM1NP2kmSTjnBd3DKp3TTm2/2pLw=; b=pNV0ztU2YBAMoDjXvnarKJUjnWCdvHaTxH0R9OIjWJ5FI6FeYikf12a897YWSovjyI pRIsToTHqUP6p+RgUz47SL7h4Eu4dLjf2j6WKNyCTNJnqkvBnww+AA1DzQ3iswgQRnHg NQUYxZYAkUm+iJ3UHwQjiwHjftkcSVihJ6Ez8AwY8YKUoSmqTuWWewoTp8TlJlz//DTe g/07Yn8Z58oZtlbM4iRcKtpIxg4vDvyqI8WHEHiteIZGawT8d63g7+laXKlUw9+sJ+qe nzCU9Ly6ww+YPiCznixqAlQEBr9usTdGrsd8JCaI0JCCM/FLa1YkLTsaiUyJBBl6UyD7 Lwwg== X-Gm-Message-State: AGi0PuYCUuJis/M9gLrY8ri32x0T2rdCnGUUglNYS3FaciZw7oeHXWzu z1BnTBQSQaIAfSDC/E5vZ/FGG4dbLt5W/A== X-Google-Smtp-Source: APiQypL+uEyUbsga+hXMGToa54CpmX3+zYfupgtWwqH5J1W083jmsUWfJ/eXZguHDsGCrMriqPsXAg== X-Received: by 2002:a2e:9948:: with SMTP id r8mr1637670ljj.1.1588238218547; Thu, 30 Apr 2020 02:16:58 -0700 (PDT) Return-Path: <ulf.hansson@linaro.org> Received: from localhost.localdomain (h-98-128-181-7.NA.cust.bahnhof.se. [98.128.181.7]) by smtp.gmail.com with ESMTPSA id x29sm4417818lfn.64.2020.04.30.02.16.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2020 02:16:57 -0700 (PDT) From: Ulf Hansson <ulf.hansson@linaro.org> To: linux-mmc@vger.kernel.org, Ulf Hansson <ulf.hansson@linaro.org> Cc: Adrian Hunter <adrian.hunter@intel.com>, Douglas Anderson <dianders@chromium.org>, Matthias Kaehlcke <mka@chromium.org>, Shawn Lin <shawn.lin@rock-chips.com>, Yong Mao <yong.mao@mediatek.com>, Chaotian Jing <chaotian.jing@mediatek.com>, stable@vger.kernel.org Subject: [PATCH 1/4] mmc: sdio: Fix potential NULL pointer error in mmc_sdio_init_card() Date: Thu, 30 Apr 2020 11:16:37 +0200 Message-Id: <20200430091640.455-2-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200430091640.455-1-ulf.hansson@linaro.org> References: <20200430091640.455-1-ulf.hansson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit |
Series |
mmc: sdio: Fix various issues in mmc_sdio_init_card()
|
expand
|
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index ebb387aa5158..d35679e6e6aa 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c @@ -718,9 +718,8 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, /* Retry init sequence, but without R4_18V_PRESENT. */ retries = 0; goto try_again; - } else { - goto remove; } + return err; } /*
During some scenarios mmc_sdio_init_card() runs a retry path for the UHS-I specific initialization, which leads to removal of the previously allocated card. A new card is then re-allocated while retrying. However, in one of the corresponding error paths we may end up to remove an already removed card, which likely leads to a NULL pointer exception. So, let's fix this. Fixes: 5fc3d80ef496 ("mmc: sdio: don't use rocr to check if the card could support UHS mode") Cc: <stable@vger.kernel.org> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> --- drivers/mmc/core/sdio.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.20.1