From patchwork Tue Feb 25 09:48:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 25274 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f200.google.com (mail-ve0-f200.google.com [209.85.128.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7719520543 for ; Tue, 25 Feb 2014 09:54:40 +0000 (UTC) Received: by mail-ve0-f200.google.com with SMTP id jw12sf269989veb.11 for ; Tue, 25 Feb 2014 01:54:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=bHXou5j48njuaCCgsD4uCp83Z+zY6fEwKrYCOHrnUA0=; b=lQ2CMRBzLgLLjYX2WWngpaGrOMzaLL0ruxNVIcyknZkhrJ0CpcGGrXoTuBxqeSYQpk dZfk1uRg/fT1jY94M9kblUcENLp3aNECwg1ZOEmkcuJ9d2/1WkBXqs5Gbv/SUdW3EMrX 7q5Ga9ZIfBUFKsoYpHSC9rtRM4gCwCUgeacwcs9IohrqrSjHyt1ggB7j8+e3MgTDkpaw /Wtv7WkHopDhbInhPCVJNBt4bEwYrIuqXIeFAWwirURSJI2yJptYeORAWacBV+Ef6pIG 0dDUhjZnYYB/r7i5/OCFf7NoOG5Y0RCCBqHIWP9LwI9kxzMs8Hl1ebLNWZ5B0Ow5i8DJ TUtw== X-Gm-Message-State: ALoCoQks3WfyoJQMbabNqZsToLpfPHojj/yCXETG1wtei1K9XWiK1Fy1UjjJdms+gx0dQmjjlQ8w X-Received: by 10.224.55.19 with SMTP id s19mr12939477qag.0.1393322080244; Tue, 25 Feb 2014 01:54:40 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.38.241 with SMTP id t104ls1582533qgt.21.gmail; Tue, 25 Feb 2014 01:54:40 -0800 (PST) X-Received: by 10.58.37.67 with SMTP id w3mr310894vej.22.1393322080149; Tue, 25 Feb 2014 01:54:40 -0800 (PST) Received: from mail-ve0-f170.google.com (mail-ve0-f170.google.com [209.85.128.170]) by mx.google.com with ESMTPS id us10si6668574vcb.134.2014.02.25.01.54.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 25 Feb 2014 01:54:40 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.170; Received: by mail-ve0-f170.google.com with SMTP id c14so150126vea.1 for ; Tue, 25 Feb 2014 01:54:40 -0800 (PST) X-Received: by 10.58.37.67 with SMTP id w3mr310885vej.22.1393322080071; Tue, 25 Feb 2014 01:54:40 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.174.196 with SMTP id u4csp125507vcz; Tue, 25 Feb 2014 01:54:39 -0800 (PST) X-Received: by 10.68.227.4 with SMTP id rw4mr5507537pbc.3.1393322077716; Tue, 25 Feb 2014 01:54:37 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id xn1si3064032pbc.128.2014.02.25.01.54.37; Tue, 25 Feb 2014 01:54:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752493AbaBYJyf (ORCPT + 7 others); Tue, 25 Feb 2014 04:54:35 -0500 Received: from mail-pb0-f50.google.com ([209.85.160.50]:45555 "EHLO mail-pb0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752318AbaBYJye (ORCPT ); Tue, 25 Feb 2014 04:54:34 -0500 Received: by mail-pb0-f50.google.com with SMTP id rq2so7917942pbb.9 for ; Tue, 25 Feb 2014 01:54:34 -0800 (PST) X-Received: by 10.68.239.70 with SMTP id vq6mr5351208pbc.152.1393322074306; Tue, 25 Feb 2014 01:54:34 -0800 (PST) Received: from linaro.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id qq5sm8804447pbb.24.2014.02.25.01.54.32 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 25 Feb 2014 01:54:33 -0800 (PST) From: Sachin Kamat To: linux-mmc@vger.kernel.org Cc: ulf.hansson@linaro.org, chris@printf.net, sachin.kamat@linaro.org Subject: [PATCH 10/10] mmc: dw_mmc: Fix NULL pointer dereference Date: Tue, 25 Feb 2014 15:18:28 +0530 Message-Id: <1393321708-9719-10-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1393321708-9719-1-git-send-email-sachin.kamat@linaro.org> References: <1393321708-9719-1-git-send-email-sachin.kamat@linaro.org> Sender: linux-mmc-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: sachin.kamat@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , If mrq->sbc is not NULL but data->stop happens to be NULL, it will lead to NULL pointer dereferencing. Avoid this by having a NULL check for data->stop. Signed-off-by: Sachin Kamat Acked-by: Seungwon Jeon --- drivers/mmc/host/dw_mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 55cd110a49c4..0c56faa6730e 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -1345,7 +1345,7 @@ static void dw_mci_tasklet_func(unsigned long priv) if (!err) { if (!data->stop || mrq->sbc) { - if (mrq->sbc) + if (mrq->sbc && data->stop) data->stop->error = 0; dw_mci_request_end(host, mrq); goto unlock;